I've been told this isn't possible which leads me to the following problem.
I have a series of events stored in a database and at the moment I pull the info out and display each one on a new line using a while loop.
What I'd like to do now is check that if the date is 0000-00-00 then the date must not be displayed.
Here's what my code looks like at the moment (without checking if the date is 0000-00-00):
<?php
// open connection to MySQL server
$connection = mysql_connect('localhost', 'username', 'password')
or die ('Unable to connect!');
//select database
mysql_select_db('database') or die ('Unable to select database!');
//create and execute query
$query = "SELECT heading, day(date), monthname(date), year(date), description FROM event ORDER BY date";
$result = mysql_query($query) or die ('Error in query: $query. ' . mysql_error());
if (mysql_num_rows($result) > 0 )
{
while($row = mysql_fetch_row($result))
{
echo "<tr>";
echo "<td><p>".$row[0]."</p><p>".$row[1]." ".$row[2]." ".$row[3]."</p><p>".$row[4]."</p></td>";
echo "</tr>";
}
}
?>
If you can help me then you might get a cookie...the edible kind ;)