I am trying to built a search page for products in which i have two table products and inventory, i have my product details in product and inventory details like color,size,pric
using PDO, something like -
$dbh = new PDO(...)
$sth = $dbh->prepare('SELECT p.product_name, p.product_sku, p.product_desc, i.inventory_color
FROM products as p
INNER JOIN invetory as i ON p.product_id = i.product_id
WHERE p.cat = ? AND i.inventory_color = ?');
$sth->execute(array($_GET['cat'], $_GET['color']));
$results = $sth->fetchAll();
from example at http://www.php.net/manual/en/pdo.prepare.php