I am trying to use this bit of code to check rows to see if there is a value set for "$row[imag_url]":
Code: Select all
$sqlbanners = "SELECT *
FROM {$ezine_id}_banners";
$resultbanners = mysql_query($sqlbanners);
$numbanners = mysql_num_rows($resultbanners);
$i = 1;
while($i <= $numbanners){
$row = mysql_fetch_assoc($resultbanners);
if($row[image_url]!=""){
?>
<td width="50%" valign="middle"><div align="right"><a href="<? echo $row[redirect_url]; ?>" target="_blank"><img src="<? echo $row[image_url]; ?>" width="180" height="100" hspace="5" vspace="0" alt="Banner advertisement" border="0"></a></div></td>
<?
$i++;
}
}I'd love to know why the script/database/page is behaving like this, and also what the syntax should be in my MySQL query to eleiminate empty fields...
Thanks in advance!