Beau Beauchamp Tue Sep 27 08:08:08 -0400 2011

Subject: New MSSQL Drivers! Sweet!

Tim Robertson (FunkJedi) has built an MSSQL driver for PHP-AR. SWEET! You can see his implementation here:

https://github.com/funkjedi/php-activerecord

It works with Microsoft's Sqlsvr driver on windows only. I've ported it to work with the DBLib driver on Linux and I'll try to have my version uploaded shortly. In the mean time, if you need Tim's driver to work with Linux, just change the name of the file and class from SqlsrvAdapter to DblibAdapter and update the DSN line wtihin the constructor (currently line 24) to:

$this->connection = new PDO ( "dblib:host=$host;dbname=$info->db", $info->user, $info->pass, static::$PDO_OPTIONS );

Nice work Tim! Maybe the project leads can pull this into the main branch sometime soon!


prajyot prabhu Tue Dec 24 03:47:50 -0500 2013

Hi Beau Beauchamp

I want to migrate a database from MySql to cloud based Sql Azure platform.I am currently using
php-Activerecord-0.0.1 with codeigniter framework and it works great with MySql.

to connect with SQL Server i tried following proceedure:
1) I was able to connect to sql server database by using SqlSrv Adapter available at url: https://github.com/funkjedi/php-activerecord/tree/master/lib/adapters.

2)As soon as it got connected,All existing activerecord-queries threw an error .That means all php-activerecord queries are not compatible with SqlServer db.

Can i use php- activerecord to query sql server database? , by doing some major or minor changes in Model.php /Table.php or SQLBuider in "php-activerecord\0.0.1\vendor\php-activerecord\lib"?

Please advice me on this.

(1-1/1)