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.
i got the following errors:
1) A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 0
Filename: lib/Model.php
Line Number: 1663
2) A PHP Error was encountered
Severity: Notice
Message: Uninitialized string offset: -1
Filename: adapters/SqlsrvAdapter.php
Line Number: 35
I also got some errors in present queries like:
Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message '42000, 1038, [Microsoft][SQL Server Native Client 11.0][SQL Server]An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name.' in php-activerecord\0.0.1\vendor\php-activerecord\lib\Connection.php:318 Stack trace: #0 php-activerecord\0.0.1\vendor\php-activerecord\lib\Table.php(218): ActiveRecord\Connection->query('SELECT * FROM [...', Array) #1 php-activerecord\0.0.1\vendor\php-activerecord\lib\Table.php(209): ActiveRecord\Table->find_by_sql('SELECT * FROM [...', Array, false, NULL) #2 php-activerecord\0.0.1\vendor\php-activerecord\lib\Model.php(1577): ActiveRecord\Table->find(Array) #3 C:php-activerecord\0.0.1\vendor\php-a in php-activerecord\0.0.1\vendor\php-activerecord\lib\Connection.php on line 318
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.