Is something wrong with my query when i am executing getting fatal error.
$select = $db->select()
->from('test', '*')
->where('user_id = ?', 1)
->where('url is NULL');
$Details = $db->fetchAll($select);
foreach ($Details as $row1) {
$PublicId = $row1['public_id'];
$data = array('password' => $randomString , 'flag' => 1);
$db->update("test", $data, 'public_id =' . $PublicId);
$pass = $row1['password'];
}
Error is:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'wdefabcghbcla45' in 'where clause'' in C:\xampp\php\PEAR\Zend\Db\Statement\Pdo.php:228 Stack trace: #0 C:\xampp\php\PEAR\Zend\Db\Statement\Pdo.php(228): PDOStatement->execute(Array) #1 C:\xampp\php\PEAR\Zend\Db\Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array) #2 C:\xampp\php\PEAR\Zend\Db\Adapter\Abstract.php(479): Zend_Db_Statement->execute(Array) #3 C:\xampp\php\PEAR\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE
test
...', Array) #4 C:\xampp\php\PEAR\Zend\Db\Adapter\Abstract.php(634): Zend_Db_Adapter_Pdo_Abstract->query('UPDATEtest
...', Array) #5 D:\Zend Workspace\Test\testDelete.php(39): Zend_Db_Adapter_Abstract->update('test', Array, 'test_public_id...') #6 {main} Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'wdefabcghbcla45' in 'where clause'' in C:\xampp\php\PEAR\Zend\Db\Statement\ in C:\xampp\php\PEAR\Zend\Db\Statement\Pdo.php on line 234