Forum Moderators: coopster
This is the code that I have so far:
$result = mysql_query ("SELECT url,name,date FROM links");
while($row = mysql_fetch_array($result)) {
if (($row['url'] == NULL) ¦¦ ($row['name'] == NULL)) {
echo "There are no links stored in the database yet.";
}
else {
echo "<p><a href=\"http://{$row['url']}\" target=\"_blank\">{$row['url']}</a><br />"."Posted by: {$row['name']} on {$row['date']}</p>";
}
}
Any help would be appreciated. Is there any way to check if something is null or not?
i would do something like this:
$result = mysql_query ("SELECT url,name,date FROM links");
$num_of_rows = mysql_num_rows($result);
if ($num_of_rows == 0) {
echo "There is no data";
}
else {
while($row = mysql_fetch_array($result)) {
echo "<p><a href=\"http://{$row['url']}\" target=\"_blank\">{$row['url']}</a><br />"."Posted by: {$row['name']} on {$row['date']}</p>";
}
Hope this helps
eelix