Hi,

 

I am working on a mini project and using the Yii 1.1 PHP framework (OOP framework, using MVC) and trying to connect to a MonetDB database (changing from MySQL).

 

I see that there is a MonetDB PHP client (https://dev.monetdb.org/hg/MonetDB/file/tip/clients/php/lib/php_monetdb.php). I believe it is MAPI based, but I don’t know if that can be used in Yii by creating a wrapper or so.

 

Yii has special classes to retrieve metadata information from database (the http://www.yiiframework.com/doc/api/1.1/CDbSchema) and it also has subclasses for several databases supported in Yii “out of the box” (cubrid, mssql, mysql, oci, pgsql and sqlite). It uses the CActiveDataProvider class which is based on ActiveRecord (http://www.yiiframework.com/doc/api/1.1/CActiveDataProvider), and has methods to retrieve the data from database along with different criteria.

 

Knowing MonetDB also has an ODBC driver, I installed unixodbc along with the PHP PDO driver for ODBC, the MonetDB ODBC driver, and have done all the needed set up to make ODBC work. By the way, my test server is an Ubuntu VM.

 

Now that I have the ODBC working, I am able to connect to the database, and when using SQL statements (building the sql query, command, datareader, etc) everything works in Yii, and I can retrieve the needed data, but when I want to use the widgets and make use of the framework and MVC, I start getting errors and I believe it’s all because of not having the right schema class. I tried “forcing” the driver name and tested all the existing schemas (the ones I specified above, that come with Yii) but to no avail.

 

I’m not a database expert or an advanced PHP (and Yii) developer but have some development experience and was able to work on this project and build a nice web application with MySQL but now that I’m planning to change the DB and use MonetDB, I believe I need expert advice and some help from real experts, and I’m hoping someone on this list will be able to shed some light. I couldn’t find much on the Internet.

 

Thank you.

 

Regards,

 

Kevork Vartanian

Technical Solutions Consultant

kevork.vartanian@innotta.com.au | +61 406 776 789 | www.innotta.com.au

 

INNOTTA Logo