Jump to content

Recommended Posts

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 error

Code:

<?
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

Link to comment
https://forums.phpfreaks.com/topic/10845-php-sql-appointment-checker/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.