|
|||
|
How to translate this mySQL query into Zend_Db_Table find() method ..
"SELECT * FROM `myTbl` WHERE `id`='$id' AND `email`='$email'" Find() method only accept single WHERE. Thanks a Lot. |
|
|||
|
Hello,
You're sure you need find method ? And directly Zend_DB_Table ? Cause i would personally go better for this: $id = $db->quote($id); $email = $db->quote($email); $sql = "SELECT * FROM `myTbl` WHERE id=$id AND email=$email"; $result $db->fetchAll($sql);/Or fetchRow if needed One advantage is you can just echo $sql to see if you get right SQL command, and also, sometime is usefull since you can test this query directly against MySQL database (through phpmyadmin maybe) to see if/why is not working properly. MySQL will give you then a better understanding on why is wrong your SQL syntax. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|