简体   繁体   English

使用Phalcon改进OpenEdge数据库

[英]Progress OpenEdge database with Phalcon

In one of my applications, I need to connect to a Progress OpenEdge database from Phalcon framework. 在我的一个应用程序中,我需要从Phalcon框架连接到Progress OpenEdge数据库。 I was looking for ODBC connection or ORM wrapper to the database. 我一直在寻找到数据库的ODBC连接或ORM包装器。

Is there any plug-in/adapter available for this task? 是否有任何可用于此任务的插件/适配器?

OpenEdge supports ODBC. OpenEdge支持ODBC。 The Datadirect drivers are free. Datadirect驱动程序是免费的。

I have not found one so I made my own model class and query the databsase with odbc_connect(). 我还没有找到一个,所以我制作了自己的模型类并使用odbc_connect()查询databsase。 But you could use it in-line if you don't want to go to the trouble. 但是,如果您不想麻烦,可以在线使用它。

To connect: 连接:

putenv("ODBCINI=/path_to/odbc.ini");
$this->conn = odbc_connect("DataBaseName","User","Password");
$this->table = "TABLE_NAME";

And query: 并查询:

$rows = odbc_exec($self->conn,$sql);
while ($row = odbc_fetch_object($rows)){
    // do some stuff
}

Read more here: http://php.net/manual/en/ref.uodbc.php 在此处阅读更多信息: http : //php.net/manual/en/ref.uodbc.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM