Hello i would like to have a top x product with image, i tested this code
<?php
$sql = "SELECT name FROM `".$config_databaseTablePrefix."products` ORDER BY rating DESC LIMIT 10";
if (database_querySelect($sql,$rows))
{
foreach($rows as $product)
{
if ($config_useRewrite)
{
$href = $config_baseHREF."product/".tapestry_hyphenate($product["name"]).".html";
}
else
{
$href = $config_baseHREF."products.php?q=".urlencode($product["name"]);
}
print "<li><a href='".$href."'>".$product["name"]."</a></li>";
}
}
?>
but i can insert the image (replacing text link with image).
thanks and sorry for my english.
Hi,
Try something like this (just need to select image_url from the DB and then display it...)
<?php
$sql = "SELECT name,image_url FROM `".$config_databaseTablePrefix."products` ORDER BY rating DESC LIMIT 10";
if (database_querySelect($sql,$rows))
{
foreach($rows as $product)
{
if ($config_useRewrite)
{
$href = $config_baseHREF."product/".tapestry_hyphenate($product["name"]).".html";
}
else
{
$href = $config_baseHREF."products.php?q=".urlencode($product["name"]);
}
print "<p><a href='".$href."'><img src='".$product["image_url"]."' border='0' /></a></p>";
}
}
?>
Hope this helps!
Cheers,
David.