Created
January 6, 2011 16:32
-
-
Save jaredhoyt/768127 to your computer and use it in GitHub Desktop.
Microsoft SQL datasource quoting issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AppController extends Controller { | |
function beforeFilter() { | |
$this->loadModel('ErpContract'); | |
debug($this->ErpContract->find('first', array( | |
'fields' => array('No_', 'Change Order No_') | |
))); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DATABASE_CONFIG { | |
var $erp = array( | |
'driver' => 'mssql', | |
'persistent' => false, | |
'host' => '', | |
'login' => '', | |
'password' => '', | |
'database' => 'ADP_NAVISION', | |
'prefix' => 'My Live Company$' | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ErpContract extends AppModel { | |
var $useDbConfig = 'erp'; | |
var $useTable = 'Contract'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL Error: Incorrect syntax near 'No_'. [CORE\cake\libs\model\datasources\dbo_source.php, line 681] | |
Query: SELECT TOP 1 [ErpContract].[No_] AS [ErpContract__0], ErpContract.Change Order No_ AS [ErpContract__1] FROM My Live Company$Contract AS [ErpContract] WHERE 1 = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment