I am new here and just registered to ask a question. First of all i am newbie to PHP,so i have not tons of experience in it. My problem is the following:
I got two tables in my database. The first one is called products. The products table gives new products in my shop an unique ID. The second one is the products_to_categories table, in this table the products_id gets an cateogries_id so you know which product belongs to which category.
Now i need to echo the images (products_images in products-table) from the last 4 products (there is also a products_date_added attribute) of a category. All i managed to do until now is to echo the links of the images from the product tables:
mysql_select_db('example2');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_assoc($retval))
{
echo "Product Image : {$row['products_image']} <br> ".
"--------------------------------<br>";
}
echo "Fetched data successfully
";
mysql_close($conn);
?>
</body>
could someone help me to do that? thanks in advance!