PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
include("config.php");
$result = mysql_query("SELECT * FROM events
WHERE upcoming='yes'");
if ($result){
while($row = mysql_fetch_array($result))
{
echo $row['name'] . " " . $row['description'];
}
}
else{
echo "no upcoming events";
}
?>
This doesn't work the way I want. I want display all the records with upcoming=yes. It works. and if there is no record i want to echo no upcoming events. It displays a blank page insread of echo "no upcoming events"; . Any other way to do this job?