Here is some code I have and there is something I'm not quite doing right, the function is giving me a problem when I try to verify if a field is NULL. The comment section shows the problem...
function display_wallpaper($wallpaper_array)
{
open_table_main();
if (!is_array($wallpaper_array)) //display all wallpaper in the array passed in
{
echo "<P> • No wallpaper currently available in this category<br>";
}
else
{
echo "<table width = \"100%\" border = 0>";
// Make each row contain 3 or more images
$i=0;
foreach ($wallpaper_array as $row)
{
{
if (!($i % 3))
{
echo"<tr>";
}
$i++;
}
echo"<TD>";
echo "<Table Border=0 Width=150 Cellpadding=0 Cellspacing=0>\n";
echo "<TR><TD COLSPAN=2><IMG SRC=\"downloads/wallpaper/".$row["thumb_img"]."\" Border=0></TD></TR>\n";
echo "<TR><TD><P CLASS=link>";
$url = "show_wallpaper.php?wallpaperid=".($row["wallpaperid"]);
$title = $row["dims_01"];
do_html_url($url, $title);
echo"</TD><TD><P CLASS=small>".$row["size_01"]."</TD></TR>\n";
echo "<TR><TD colspan=2><P CLASS=small>Viewed: ".$row["downloads"]." times</TD></TR>\n";
// Here is the actual problem, I want this to NOT display any of the following info if it finds these empty. But it keeps giving me a function error.
// What am I doing wrong here?
if ($wallpaper_array[dims_02] == NOT NULL)
{
echo "<TR><TD><P CLASS=link>";
$url2 = "show_wallpaper_1024.php?wallpaperid=".($row["wallpaperid"]);
$title2 = $row["dims_02"];
do_html_url($url2, $title2);
echo"</TD><TD><P class=small>".$row["size_02"]."</TD></TR>\n";
echo "<TR><TD colspan=2><P class=small>Viewed: ".$row["downloads_02"]." times</TD></TR>\n";
}
else
{
echo "<TR><TD colspan=2><P class=small> </TD></TR>\n";
}
// End Problem Area
echo "</Table></TD>";
}
echo "</tr>";
echo"</table>";
}
close_table_main();
}
Any suggestions on what I'm doing is wrong is greatly appreciated. I'm sure it has to do with this part here:
if ($wallpaper_array[dims_02] == NOT NULL) // Help!
{
echo "<TR><TD><P CLASS=link>";
$url2 = "show_wallpaper_1024.php?wallpaperid=".($row["wallpaperid"]);
$title2 = $row["dims_02"];
do_html_url($url2, $title2);
echo"</TD><TD><P class=small>".$row["size_02"]."</TD></TR>\n";
echo "<TR><TD colspan=2><P class=small>Viewed: ".$row["downloads_02"]." times</TD></TR>\n";
}