could u kindly rephrase that...
as in you dont want the student to be able to make a booking for a certain time he has already had made a booking for?
if thats so i suppose you must be having a form where you have defined time slots
now before entering the data to the database just run a query to check if person with that studentid or whatever has not already made a booking
PHP Code:
$sql = "SELECT time FROM booking WHERE id='$studentid' AND time='$postedtime'"; $query = mysql_query($sql); if (mysql_num_rows($query) > 0) { echo "You already have appointment for that time slot"; } else { //enter the data }
$postedtime= value coming from the newly submitted form
tell me if that bunch of code helps.. coz i am lil unsure abt that AND coming in SELECT statement with WHERE
anyway if that doesnt help there can be a work around
Last edited by convinceme; 04-21-2006 at 01:54 AM..
|