I am using Zend's convenience methods for DB calls fetchAll. This, as the knowledgeable ones should know is a function that allows parameterization of queries. For instance, the query could be:
$query = "select * from user where email = ?"
$results = $this->_db->fetchAll($query, $email);
And this is how a parameterization can be achieved.
My query however, is this:
$query = "select * from user where email in ("noLuck@hotmail.com", "hotmailsucks@gmail.com","gmailrocks@hotmail.com");
How can I parameterize the above query, because those emails are user inputs so I am not going to simply have them in the raw query and trying the following failed:
$query = "select * from user where email in ? ";
$this->_db->fetchAll($query, $commaSeparatedEmailList);
where $commaSeparatedEmailList = "(".implode("," , $emails).")";
Any ideas ?