Can anyone tell me why this works:
$display_title = mysql_query("SELECT date_FORMAT(date,'%m/%d/%Y') AS date, title, author, authoremail FROM news")
or die ("MySQL Error");
if (mysql_num_rows($display_title) > 0)
{
while ($row = mysql_fetch_array($display_title))
{
$date = $row ["date"];
$title = $row ["title"];
$author = $row ["author"];
$email = $row ["authoremail"];
echo "<table width=\"400\" border=\"1\" cellspacing=\"5\" cellpadding=\"5\">
<tr>
<td><p>Title: $title<BR>By: <a href=\"mailto:$email\">$author</a><BR>Posted On $date</p></td>
</tr>
</table>";
}
}
and this doesn't:
$query = mysql_query("SELECT date_FORMAT(date,'%m/%d/%Y') AS date, title, author, authoremail FROM news");
if (mysql_num_rows($query) > 0)
{
while ($row = mysql_fetch_array($query));
{
$date = $row ["date"];
$title = $row ["title"];
$author = $row ["author"];
$email = $row ["authoremail"];
echo "<table width=\"400\" border=\"1\" cellspacing=\"5\" cellpadding=\"5\">
<tr>
<td><p>Title: $title<BR>By: <a href=\"mailto:$email\">$author</a><BR>Posted On $date</p></td>
</tr>
</table>";
}
}
I don't even see a difference...