No value in database...Newbie help
Posted: Wed Feb 23, 2005 7:08 pm
Hi..
I am running this code to display all operation details when the page is loaded
the problem i am getting is that when there are NO fields in the database for the current date the $result is not 0. When i try to echo the result it returns Resource id #3.......
can anyone tell me how i can make it display no operations booked when the query returns nothing ??
I am running this code to display all operation details when the page is loaded
Code: Select all
$query = "SELECT * FROM OperationDetails WHERE Date='$date'";
if ( !($result = mysql_query($query,$link)) ) {
echo ("Error connecting to database");
} else {
if ( $result == 0 ) {
echo ("No operations booked");
} else {
.....display datacan anyone tell me how i can make it display no operations booked when the query returns nothing ??