Ok , I have just used the COUNT() function to give me either the number 0 or anything else.
II then run the query like so:
Code:
$query = "SELECT COUNT(date) FROM bookings WHERE (date = '$date' OR date = SUBDATE('$date', INTERVAL 2 DAY))";
$result = @mysql_query ($query); //run the query
]
I then compare it to so that if it equals 0 I can proceed with whatever I want. If it donest equal 0 I just want it to shout at me, which it does, but it does it all the time. What I use is
Code:
if ($result == '0'){
//Do this
}
else{
//shout at me
}
]
However, all this does is skips to the else, even when $result should be 0. I have tried with and without the inverted commas but no joy..