Jeff, following is the code as it comes out in my page...can u tell me what i'm doin wrong, besides the fact that i have to replace that famous "uh ohh i got a row back()" with an actual snippet : <?php $db = mysql_connect("localhost","root"); mysql_select_db("nidc_intranet",$db); $realsdate="$syear"."-"."$smonth"."-"."$stdate"; $realedate="$eyear"."-"."$emonth"."-"."$endate"; $realstime="$shh".":"."$smm"." "."$sttime"; $realetime="$ehh".":"."$emm"." "."$entime"; $result = mysql_query("select * from booking where ('$realsdate'>=sdate and '$realsdate'<=edate) or ('$realedate'>=sdate and '$realedate'<=edate)",$db); if (uh_ohh_I_got_a_row_back()) { echo "Someone else is sleeping in the bed! No can do!"; } else { $sql = "INSERT INTO booking (room,sdate,edate,stime,etime,purpose,reserved) VALUES ('$rooms','$realsdate','$realedate','$realstime','$realetime','$purpose','$res')"; $result = mysql_query($sql) or Die ("An unexpected error occured. Please go back and book again."); echo "<font face=helvetica size=2 color=#140057><b>Thank you! <font color=#ff0000>$rooms</font>, has been booked from <font color=#ff0000>$realsdate</font> to <font color=#ff0000>$realedate</font>. <br><br> ** Entries will be deleted 2 weeks after the End Date. "; } ?> Cheers, T. Edison jr. ===== Rahul S. Johari (Director) ****************************************** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 ******************************************* __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]