This script for some reason will not echo what I want when the data selected form the database is nothing.
<?php
require_once("./db_conn.inc");
$query = "SELECT name, id, desc FROM links WHERE cat = '$id'";
$result = mysql_query($query, $link_id);
while ($data = mysql_fetch_row($result))
{
if ($data=='' || !$data) /* this will not work??? I dont know why */
{
echo "<tr><td class=\"padding\">No Links Are Avaliable for this Section</td></tr>";
}
else
{
echo "<tr><td><table width=\"570\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\" bgcolor=\"#000000\"><tr><td><table width=\"570\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\">";
echo "<tr width=\"100%\"><td class=\"top_dev2\"> <a class=\"links\" href=http://www.phpbuilder.com/board/archive/index.php/\"/links/displaylink.php?id=",$data[1],"\">",$data[0],"</a></td></tr><tr><td class=\"intro\">",$data[2],"</td></tr></table></td></tr></table><br>";
}
}
?>
<?php
require_once("./db_conn.inc");
$query = "SELECT name, id, desc FROM links WHERE cat = '$id'";
$result = mysql_query($query, $link_id);
while ($data = mysql_fetch_row($result))
{
if ($data=='' || !$data) /* this will not work??? I dont know why */
{
echo "<tr><td class=\"padding\">No Links Are Avaliable for this Section</td></tr>";
}
else
{
echo "<tr><td><table width=\"570\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\" bgcolor=\"#000000\"><tr><td><table width=\"570\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\">";
echo "<tr width=\"100%\"><td class=\"top_dev2\"> <a class=\"links\" href=http://www.phpbuilder.com/board/archive/index.php/\"/links/displaylink.php?id=",$data[1],"\">",$data[0],"</a></td></tr><tr><td class=\"intro\">",$data[2],"</td></tr></table></td></tr></table><br>";
}
}
?>