UpdateAll not working in CakePHP
I have a query written to Edit a particular ROW with respect to ID. I'm
using a UPDATEALL() function to update my record.
this is the general syntax used in CakePHP, also I'm using this same
syntax below
$this->Ticket->updateAll(
array('Ticket.status' => "'closed'"),
array('Ticket.customer_id' => 453)
);
My code however looks like this.
$this->Invoicecustomers->updateAll(
array(
'user_id'=> $_GET['user_id'],
'inv_id' => $_GET['inv_id']
),array(
'Invoicecustomers.user_id'=> $_GET['user_id'],
'Invoicecustomers.inv_id' => $_GET['inv_id'])
);
$_GET['user_id'] & $_GET['inv_id'] are fetched from the URL It throws me
an error when I run the edit function.
Also when Echoed $_GET['user_id'] & $_GET['inv_id'] , results are not
empty. SO I'm sending any null data here.
It gives me 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
Is my syntax wrong in any way.?
No comments:
Post a Comment