i have written the following function to update the table
Code: Select all
public function updateDetails($uData, $uid)
{
$db = Zend_Registry::get('db');
foreach ($uData as $key => $value) {
$data = array('value' => $value);
$where[] = $this->getAdapter()->quoteInto('uid = ?', $uid);
$where[] = $this->getAdapter()->quoteInto('key = ?', $key);
}
$this->update($data, $where);
return $uData;
}i am getting the following error.........
Code: Select all
Uncaught exception 'Zend_Db_Statement_Exception' with message '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 'key = 'fname') AND (uid = '1') AND (key = 'lname') AND (uid = '1') AND (key = 'd' at line 1' in C:\xampp\reawu\library\Zend\Db\Statement\Pdo.php:238 Stack trace: #0 C:\xampp\reawu\library\Zend\Db\Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array) #1 C:\xampp\reawu\library\Zend\Db\Adapter\Abstract.php(433): Zend_Db_Statement->execute(Array) #2 C:\xampp\reawu\library\Zend\Db\Adapter\Pdo\Abstract.php(230): Zend_Db_Adapter_Abstract->query('UPDATE `uperson...', Array) #3 C:\xampp\reawu\library\Zend\Db\Adapter\Abstract.php(554): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE `uperson...', Array) #4 C:\xampp\reawu\library\Zend\Db\Table\Abstract.php(958): Zend_Db_Adapter_Abstract->update('upersonal', Array, Array) #5 C:\xampp\reawu\application\default\models\uper in C:\xampp\reawu\library\Zend\Db\Statement\Pdo.php on line 238thanks in advance for your cooperation..