Ok this time the code below should query the db and flag if there are 2 records already in the db matching the time and date, yet it doesnt - however as before with my other problems it works fine on my test server so any clues any one
many thanks chrisioPHP Code:$alarm_check = "SELECT atime, datetoplay FROM maintable WHERE atime = '" . $_POST['alarmtime'] . "' And datetoplay = '" . $_POST['datebox'] . "'"; // check if username exists in database.
if (!($alarm_check)) print mysql_error();
$result1 = mysql_query($alarm_check);
$num_row = mysql_num_rows($result1);
if ($num_row == 2)
{
die('<p align="center"><strong><font face="Century Gothic">Im sorry but this time slot is full.</font></strong></p><p align="center"><font face="Century Gothic"><a href="newentry.php">Please go back and pick another time</a></font></p><p align="center"><a href="index.html"><img src="images/smallhouse.gif" alt="Home" width="53" height="67" border="0"></a></p>');
//die ($num_row);
}
![]()




Reply With Quote