The rewrite:
RewriteRule ^product/(.*)/(.*)$ shop_product_detail.php?man=$1&perm=$2 [NC,L,QSA,T=application/x-httpd-php]
and the recordset:
<?php
$Products = new WA_MySQLi_RS("Products",$DBConnection,1);
$Products->setQuery("SELECT products.*, productcategories.*, productmanufacturers.*, (SELECT sum(OptionPrice) FROM optiongroups INNER JOIN options ON options.OptionGroupID = optiongroups.OptionGroupID WHERE OptionProductID=ProductID) AS OptionPrice FROM products INNER JOIN productcategories ON products.ProductCategoryID = productcategories.CategoryID INNER JOIN productmanufacturers ON products.ProductManufacturerID = productmanufacturers.ManufacturerID WHERE (products.ProductID = ? OR (products.ProdPermalink = ? AND productmanufactureres.ProductManufacturer = ?)) AND products.ProductLive = 1");
$Products->bindParam("i", "".(isset($_GET['id'])?$_GET['id']:"") ."", "-1"); //paramProductID
$Products->bindParam("s", "".(isset($_GET['perm'])?$_GET['perm']:"") ."", "-1"); //paramPermalink
$Products->bindParam("s", "".(isset($_GET['man'])?$_GET['man']:"") ."", "-1"); //paramManufacturer
$Products->execute();
?>