I am trying to get strings that are in an array of integers that I have using Zend Framework 1.11.
$this->dbSelect ->from($table_prefix . 'product_link') ->joinLeft($table_prefix . 'product_link_name', $table_prefix . 'product_link.product_link_name_ref_id = ' . $table_prefix . 'product_link_name.product_link_name_id') ->where('product_ref_id IN (?)', implode(', ', $product_ids));
When I use the __toString() $this->dbSelect , I get
SELECT `phc_distrib_product_link`.*, `phc_distrib_product_link_name`.* FROM `phc_distrib_product_link` LEFT JOIN `phc_distrib_product_link_name` ON phc_distrib_product_link.product_link_name_ref_id = phc_distrib_product_link_name.product_link_name_id WHERE (product_ref_id IN ('10, 12'))
This returns rows satisfying the condition when product_ref_id = 10. How can I get the IN clause
product_ref_id IN ('10', '12')
or
product_ref_id IN (10, 12)
using the prepared Zend DB statements so that I can get all the rows contained within the array of product identifiers?
mysql escaping prepared-statement zend-framework
danronmoon
source share