ccrevcypsys Posted August 28, 2007 Share Posted August 28, 2007 Hey guys this script is just repeating the same image over again for each entry. heres a picture [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] Quote Link to comment https://forums.phpfreaks.com/topic/67063-solved-repeating-images/ Share on other sites More sharing options...
lemmin Posted August 28, 2007 Share Posted August 28, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/67063-solved-repeating-images/#findComment-336303 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.