To do a LIKE search with PDO, I need to add the % parameter before passing it.
It works:
$qry = ' SELECT product_id FROM cart_product WHERE product_manufacturer_num LIKE :search_string '; $sth = $this->pdo->prepare($qry); $sth->execute( array("search_string"=>'%'.$search_string.'%') );
For me, this is more like a hack, is there a more formal way to do this?
php pdo
JD Isaacks Oct 25 '10 at 13:50 2010-10-25 13:50
source share