Jump to content

[SOLVED] Repeating images


ccrevcypsys

Recommended Posts

Hey guys this script is just repeating the same image over again for each entry.

heres a picture

repeat.gif

[script]

<?php

$popularProdImg = $db->select("SELECT productId, ".$glob['dbprefix']."CubeCart_inventory.image, albumName, price, name, productCode, sale_price, digital_sample, firstName,lastName, popularity, deleted FROM ".$glob['dbprefix']."CubeCart_inventory LEFT JOIN ".$glob['dbprefix']."CubeCart_customer on ".$glob['dbprefix']."CubeCart_inventory.customer_id=".$glob['dbprefix']."CubeCart_customer.customer_id WHERE `showFeatured` = 1 AND deleted = 0 ORDER BY productId DESC LIMIT 5");

for ($i=0; $i<count($popularProds); $i++){

if(($val = prodAltLang($popularProdImg[$i]['productId'])) == TRUE){

$popularProdImg[$i]['name'] = $val['name'];

 

}

if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$popularProdImg[$i]['image'])){

$box_content->assign("VAL_IMG_SRC",$GLOBALS['songURL']."images/uploads/thumbs/thumb_".$popularProdImg[$i]['image']);

} else {

$box_content->assign("VAL_IMG_SRC",$GLOBALS['songURL']."skins/".$config['skinDir']."/styleImages/thumb_nophoto.gif");

}

?>

[/script]

Link to comment
https://forums.phpfreaks.com/topic/67063-solved-repeating-images/
Share on other sites

The "ON" after a JOIN clause should be making a comparison between something in the table on the left of JOIN and the one on the RIGHT (or the other way around.) I'm not sure it makes sense the way you are doing it. I may be wrong, but I would suggest trying to change that. in any case, I am pretty sure it is a MySQL problem, so you might want to try the MySQL Help forum.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.