What's wrong with this code?
| From: | David Mehler | Date: | Sat, 05 Jun 2010 23:54:22 +0000 |
| Subject: | What's wrong with this code? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-305850@lists.php.net to get a copy of this message | ||
Hello,
I've got a while loop outputting values from a database. Briefly it
looks like this:
while($row = mysql_fetch_array($result3))
{
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['type'] . "</td>";
echo "<td>" . $row['startdate'] . "</td>";
if (!empty($row['EndDate'])) {
echo "<td>" . $row['enddate'] . "</td>";
} else {
exit();
}
echo "<td>" . $row['location'] . "</td>";
echo "<td>" . $row['summary'] . "</td>";
echo "<td>" . $row['description'] . "</td>";
echo "</tr>";
}
That's not the whole code, but it is the problem code. Some output has
the ending date set, one or two records i can't remember how many i
entered with one, most do not, i want the echo to be conditional. The
output stops right before the if statement, echoes startdate and
that's it, comment out the if block and it works fine.
Thanks.
Dave.