Jump to content

[SOLVED] n00b question display row ?


ccrevcypsys

Recommended Posts

can anyone help me. i cant remember how to not display a row if it has a certain variable.

i need to display all of the rows with a 0 under the deleted column.

not the ones with the number 1 under the deleted column. this is what i have so far.

its quite a bit of code so ya.

<?php
$latestProducts = $db->select("SELECT productId, ".$glob['dbprefix']."CubeCart_inventory.type, image, albumName, price, name, productCode, sale_price, digital_sample, firstName,lastName, 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 ORDER BY productId DESC LIMIT 17");
if($config['showLatestProds']==1 && $latestProducts==TRUE){
if($latestProducts['deleted']==1) {
}
for($i=0;$i<count($latestProducts);$i++){
	if(($val = prodAltLang($latestProducts[$i]['productId'])) == TRUE){
			$latestProducts[$i]['name'] = $val['name'];
	}
if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$latestProducts[$i]['image'])){	
$index->assign("VAL_IMG_SRC",$GLOBALS['songURL']."images/uploads/thumbs/thumb_".$latestProducts[$i]['image']);
	} else {
$index->assign("VAL_IMG_SRC",$GLOBALS['songURL']."skins/".$config['skinDir']."/styleImages/thumb_nophoto.gif");
	}
$index->assign("LANG_LATEST_PRODUCTS",$lang['front']['index']['latest_products']);
if(salePrice($latestProducts[$i]['price'], $latestProducts[$i]['sale_price'])==FALSE){

		$index->assign("TXT_PRICE",priceFormat($latestProducts[$i]['price']));
} else {	
		$index->assign("TXT_PRICE","<span class='txtOldPrice'>".priceFormat($latestProducts[$i]['price'])."</span>");
}
	$salePrice = salePrice($latestProducts[$i]['price'], $latestProducts[$i]['sale_price']);
if($i%2==0)
	$index->assign("TD_CLASS","class='tdlisting'");
else
	$index->assign("TD_CLASS","class='tdlisting2'");
$index->assign("VAL_WIDTH", $config['gdthumbSize']+75);
$index->assign("VAL_PRODUCT_CODE",validHTML($latestProducts[$i]['productCode']));
$index->assign("TXT_ARTIST",validHTML($latestProducts[$i]['firstName']." ".$latestProducts[$i]['lastName']));
//$index->assign("TXT_ALBUM_NAME",validHTML($latestProducts[$i]['albumName']));
$index->assign("TXT_SALE_PRICE", priceFormat($salePrice));
$index->assign("PRODUCT_ID",$latestProducts[$i]['productId']);
$index->assign("VAL_PRODUCT_NAME",validHTML($latestProducts[$i]['name']));
$randnum=rand(100,999);
if($latestProducts[$i]['type']=='Song')
	$index->assign("TXT_DIGITAL_SAMPLE","<p id='player".$latestProducts[$i]['productId']."'><a href='http://www.macromedia.com/go/getflashplayer'>Get the Flash Player</a> to see this player.</p><script type='text/javascript'>     var s".$latestProducts[$i]['productId']." = new SWFObject('player/flvplayer.swf?.$randnum','single','17','20','7');\n      s".$latestProducts[$i]['productId'].".addVariable('file','".$latestProducts[$i]['digital_sample']."');   \n s".$latestProducts[$i]['productId'].".addVariable('image','preview.jpg');\n     s".$latestProducts[$i]['productId'].".write('player".$latestProducts[$i]['productId']."');\n</script>");
else
$index->assign("TXT_DIGITAL_SAMPLE","<p id='player".$latestProducts[$i]['productId']."'><a href='http://www.macromedia.com/go/getflashplayer'>Get the Flash Player</a> to see this player.</p><script type='text/javascript'>     var s1 = new SWFObject('player/flvplayer.swf?.$randnum','playlist','100','50','7');      s1.addVariable('file','playlist.php?prodid=".$latestProducts[$i]['productId']."');   s1.addVariable('displayheight','0'); s1.addVariable('width','100');  s1.addVariable('backcolor','0x000000'); s1.addVariable('frontcolor','0xCCCCCC');       s1.addVariable('lightcolor','0x557722'); s1.write('player".$latestProducts[$i]['productId']."');</script>");
$index->parse("index.latest_prods.repeat_prods");
}
$index->parse("index.latest_prods");	
}
?>

Link to comment
https://forums.phpfreaks.com/topic/66229-solved-n00b-question-display-row/
Share on other sites

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.