I feel bad because I ate something bad. Can someone tell me what I ate? You might want to include the function...just maybe
K -----Original Message----- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Tom van den Berk Sent: Wednesday, March 02, 2011 8:10 AM To: CakePHP Subject: Model function error Hello Everybody, I am having a problem with CakePHP models. I have several in use but only one gives me an error when i add a function and call it from a controller. I have a model called Invoice with a saveValue function which works like a charm. I also have model with the same function but this one gives me the following error message. It seems the function is not called and the function name is being passed as SQL code. <pre class="cake-debug"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr1-trace').style.display = (document.getElementById('cakeErr1-trace').style.display == 'none' ? '' : 'none');"><b>Warning</b> (512)</a>: <span style="color: Red; text- align: left;"><b>SQL Error:</b> 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'saveValue' at line 1</span> [<b>CORE \cake\libs\model\datasources\dbo_source.php</b>, line <b>684</b>]<div id="cakeErr1-trace" class="cake-stack-trace" style=""><a href="javascript:void(0);" onclick="document.getElementById('cakeErr1- code').style.display = (document.getElementById('cakeErr1- code').style.display == 'none' ? '' : 'none')">Code</a> | <a href="javascript:void(0);" onclick="document.getElementById('cakeErr1- context').style.display = (document.getElementById('cakeErr1- context').style.display == 'none' ? '' : 'none')">Context</a><div id="cakeErr1-code" class="cake-code-dump" style="display: none;"><pre><code><span style="color: rgb(0, 0, 0);">   ; $out = null;</span></code> <code><span style="color: rgb(0, 0, 0);">   ;if ($error) {</span></code> <span class="code-highlight"><code><span style="color: rgb(0, 0, 0);">   ; trigger_error('<span style="color:Red;text- align:left"><b>' . __('SQL Error:', true) . "</ b> {$this->error}</span>", E_USER_WARNING);</ span></code></span></pre></div><pre id="cakeErr1-context" class="cake- context" style="display: none;">$sql = "saveValue" $error = "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'saveValue' at line 1" $out = null</pre><pre class="stack-trace">DboSource::showQuery() - CORE \cake\libs\model\datasources\dbo_source.php, line 684 DboSource::execute() - CORE\cake\libs\model\datasources \dbo_source.php, line 266 DboSource::fetchAll() - CORE\cake\libs\model\datasources \dbo_source.php, line 410 DboSource::query() - CORE\cake\libs\model\datasources\dbo_source.php, line 364 Model::call__() - CORE\cake\libs\model\model.php, line 502 Overloadable::__call() - CORE\cake\libs\overloadable_php5.php, line 50 AppModel::saveValue() - [internal], line ?? InvoicesController::edit() - APP\controllers\invoices_controller.php, line 225 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171 [main] - APP\webroot\index.php, line 83</pre></div></pre><pre><p style="text-align: left;"><b>Query:</b> saveValue </p></pre> Any help would be greatly appreciated. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php