Total newbie request I know... I'm sure there's a much better way of coding this, if anyone has any suggestions it would be VERY MUCH appreciated!
I'm trying to pull a banner ad ONLY if it's present in a column named "banner" and I'd like no <div> to appear if it's not present. I currently have the full file path entered in the "banner" column for the respective bands but I'm sure there's a simpler and less convoluted way.
<?php
$result = mysql_query("SELECT banner FROM bands WHERE bandfolder='$band'")
or die(mysql_error()); $row = mysql_fetch_array( $result );
echo '<div id="news-banner">';
echo '<img src="'; echo $row['banner']; echo '" alt="'; echo $row['band'];
echo '" title="'; echo $row['band']; echo '" />';
echo '</div>';
?>