carlbrooker Posted May 31, 2006 Share Posted May 31, 2006 i have this code and keep getting an error at the line "$msg=$msg. "Appointment Already taken, please make another <BR>";The code is checking whether the appointment is already taken.Can anyone help. Here is the full code and the errorCode:<?include("sqlvars.php");$connection = mysql_connect("$servername","$dbusername","$dbpassword"); if (!$connection) die ("Could not connect MySQL"); mysql_select_db($dbname,$connection) or die ("Could not open database");if(isset($todo) and $todo=="post"){$status = "OK";$msg= "";if(mysql_num_rows(mysql_query("SELECT vetid,date,time FROM appointments WHERE vetid = '$vetid' AND date = '$dateYr-$dateMonth-$dateDay' AND time = '$time';))){$msg=$msg. "Appointment Already taken, please make another <BR>";$status= "NOTOK";} if($status<>"OK"){ echo "<font face='Verdana' size='2' color=red>$msg</font><br><input type='button' value='Retry' onClick='history.go(-1)'>";}else{ // if all validations are passed.$query=mysql_query("insert into appointments(userid,petid,vetid,date,time,reason) values('$session[userid]','$petid','$vetid','$dateYr-$dateMonth-$dateDay','$time','$reason')");echo "<font face='Verdana' size='2' color=green>Thank you for booking your appointment on $dateYr-$dateMonth-$dateDay at $time<br></font>";}}?>Error:Parse error: parse error, unexpected T_STRING in /vets/mkappointck.php on line 15 Quote Link to comment https://forums.phpfreaks.com/topic/10845-php-sql-appointment-checker/ Share on other sites More sharing options...
AndyB Posted May 31, 2006 Share Posted May 31, 2006 You have forgotten the closing " in the SELECT statement. Quote Link to comment https://forums.phpfreaks.com/topic/10845-php-sql-appointment-checker/#findComment-40519 Share on other sites More sharing options...
carlbrooker Posted May 31, 2006 Author Share Posted May 31, 2006 All working now! Many Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/10845-php-sql-appointment-checker/#findComment-40532 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.