Reputation: 418
In one of my applications, I need to connect to a Progress OpenEdge database from Phalcon framework. I was looking for ODBC connection or ORM wrapper to the database.
Is there any plug-in/adapter available for this task?
Upvotes: 0
Views: 135
Reputation: 11
I have not found one so I made my own model class and query the databsase with odbc_connect(). 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
Upvotes: 0