Am developing an app using zend framework. I want to update some columns in a table using zend db update but its not working. My code is something like this.
$where=$table->getAdepter()->quoteInto('from=?',$user_id);
$numrows=$table->update(array('read'=>1),$where);
But as I told this is not working. I tried passing where clause as array like this:
$table->update(array('read'=>1),array('from'=>$user_id));
I also tried passing where as string:
$table->update(array('read'=>1),'"from"='.$user_id);
But none of these are working. Can anyone help.
Got the answer. The problem was about keywords. to and from keywords are reserved in SQL and that was creating problem. I changed the column names and it worked. Thanks all.