Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.