This is one of the many symptoms of the model you're calling not being of the class you think it is.
There's a longer description on stack overflow but in this case:
Model names are by convention singular - so most likely changing that to:
> $this->Invoice
(and correcting whatever reference is loading an InvoiceS model) will fix the problem. If it does not, see the linked SO question for more detailed advice.
AD
On Friday, 20 June 2014 16:54:27 UTC+2, vbpupil wrote:
hey Guys
im getting this errorDatabase Error
Error: SQLSTATE[42000]: Syntax error or access violation: 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 'saveMyInv' at line 1
SQL Query: saveMyInv
from within my App controller im calling
$invId = $this->Invoices->saveMyInv(array(
'Invoices.user_id'=>$property['User']['id'],
'Invoices.property_id'=>$transaction[' InstantPaymentNotification'][' custom'],
));
and from my Invoice model my code is:
public function saveMyInv($data){
if ($this->save($data)) {
return $this->getLastInsertId();
}
}
whats odd is that it thinks my sql query is saveMyInv
have been stumped for a while now, so any help is greatly appreciated.
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment