Hi I am getting very frustrated with my php code I am relitivaly new to php and need a little help displaying multiple results from mysql within the one page and it wont do it!! what am I missing??
I am displaying the results with this code but feel I must missing something from one or another part of my code??
Please help me out
<?php echo $image; ?>
<?php
$productid = $_GET['id'];
$query = "SELECT * FROM shop_products WHERE productid = '" . $productid . "'";
$result = mysql_query($query) or die( "An error has occured: " .mysql_error (). ":" .mysql_errno ());
if (mysql_num_rows($result) > 0)
{
while ($row = mysql_fetch_array($result))
{
// Get an image
$queryi = "SELECT filename FROM images WHERE productid = '" . $row['productid'] . "' LIMIT 0,4";
$resulti = mysql_query($queryi) or die( "An error has occured: " .mysql_error (). ":" .mysql_errno ());
$tweener = mysql_fetch_row($resulti);
$filename = $tweener[0];
if ($filename != "")
{
// Resize thumbs ready for display
$imagesizer = getimagesize($root . 'admin/uploads/' . $filename);
$imgrs = imageResize($imagesizer[0], $imagesizer[1], 300);
$image = '<img src="' . $root . 'admin/uploads/' . $filename . '" alt="' . $row['productid'] . '" ' . $imgrs . ' />';
}
else
{
$image = '<img src="' . $root . 'assets/no-image-large.jpg" alt="No Image Available" />';
}
?>