cakephp / datasources

CakePHP Datasources
http://cakephp.org
237 stars 114 forks source link

Sqlsrv driver gives incorrect syntax #71

Open ghost opened 11 years ago

ghost commented 11 years ago

Created by Ben B, 9th Aug 2011. (originally Lighthouse ticket #26):


Running a cake 1.3.11 site with the latest PHP sqlsrv drivers from microsft and the cakePHP dbo_sqlsrv driver from this project I get the following error when any SQL statements are executed on my site:

Warning (512): SQL Error: [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'execute'.
 [CORE\cake\libs\model\datasources\dbo_source.php, line 684]
Query: execute 

The query it tries to run is literally the string "execute" on it's own. Here is the connection info it's using:

var $default = array(
        'driver' => 'Datasources.DboSqlsrv',
        'persistent' => false,
        'host' => 'ITSRV',
        'login' => 'sa',
        'password' => 'password',
        'database' => 'DB',
        'prefix' => 'pre_',
    );
ghost commented 11 years ago

31st Aug 2011, Ben B said:


Sounds like you're using $this->execute($sql), the new format (since cake 1.3 I believe) has been $this->query($sql)