//ob_start();
require 'connect.php';
//var_dump($sessid);
?>
include 'numcart.php';
$sql = "select id, name from $maincategory";
foreach ($dbh->query($sql) as $mainrow)
{
$id = $mainrow[0];
$name = $mainrow[1];
echo ''.$name.'
';
$innersql = "select $category.id,$category.name,count($products.id) from $category,$products WHERE $category.id=$products.catid and $category.maincatid = '$id' group by $category.id order by $category.name asc";
foreach ($dbh->query($innersql) as $row)
{
$catid = $row[0];
$catname = $row[1];
$prodCount = $row[2];
echo ' '.$catname.'('.$prodCount.')
';
}
}
//include 'pricefilter.php';
?>
View your cart
$secondsql = "select $products.id,$products.name,$products.descrip,$products.price,$category.id,$category.name
from $spec,$products,$category where $products.id = $spec.prodid and $products.catid = $category.id and $spec.spec = 'yes'";
?>
$secondsql= "select * from 3321_products";
$stm = $dbh->prepare($secondsql);
$stm->execute();
foreach ($stm->fetchAll() as $secondrow)
{
echo '
';
$img = $secondrow[0].'/1.jpg';
$name = $secondrow[1];
$desc = $secondrow[2];
$price = $secondrow[3];
$catid = $secondrow[4];
$catname = $secondrow[5];
echo '
';
echo $name.'
'.$desc.'
'.$price.'
View All Products from this Category';
echo '';
}
$dbh = null;
include 'footer.php';
?>