dont understand why this code isnt working.

below ive pasted my code ive written, its coming back giving me an error on line 71 which ive highlighted that area in red. please let me know if you see anything im missing… ?

this is the error: Parse error: syntax error, unexpected ‘}’, expecting ‘,’ or ‘;’ in /home/boulder7/public_html/book2.php on line 71

here is the action below.


<?php // contact to database $connect = mysql_connect("localhost", "boulder7_admin", "someone552083") or die ("Error , check your server connection."); mysql_select_db("boulder7_testdb"); //Get data in local variable $v_firstname=$_POST['firstname']; $v_lastname=$_POST['lastname']; $v_address=$_POST['address']; $v_city=$_POST['city']; $v_state=$_POST['state']; $v_zip=$_POST['zip']; $v_homephone=$_POST['homephone']; $v_cellphone=$_POST['cellphone']; $v_email=$_POST['email']; $v_dogname=$_POST['dogname']; $v_male=$_POST['male']; $v_female=$_POST['female']; $v_dogbreed=$_POST['dogbreed']; $v_dropdate=$_POST['dropdate']; $v_pickupdate=$_POST['pickupdate']; $v_ppl_aggr_yes=$_POST['ppl_aggr_yes']; $v_ppl_aggr_no=$_POST['ppl_aggr_no']; $v_dog_aggr_yes=$_POST['dog_aggr_yes']; $v_dog_aggr_no=$_POST['dog_aggr_no']; $v_food_aggr_yes=$_POST['food_aggr_yes']; $v_food_aggr_no=$_POST['food_aggr_no']; $v_dog_fixed_yes=$_POST['dog_fixed_yes']; $v_dog_fixed_no=$_POST['dog_fixed_no']; $v_instructions=$_POST['instructions']; // check for availability $mysql = ("SELECT * FROM contact WHERE dropdate = BETWEEN '$v_dropdate' AND '$v_pickupdate' AND pickupdate = BETWEEN '$v_dropdate' AND '$v_pickupdate'"); $result = mysql_query($query); $count = mysql_num_rows($result); if($count > 4) { echo "We are currently booked, someone will contact you." } else { $query="insert into contact(firstname,lastname,address,city,state,zip,homephone,cellphone,email,dogname,male,female,dogbreed,dropdate,pickupdate,ppl_aggr_yes,ppl_aggr_no,dog_aggr_yes,dog_aggr_no,food_aggr_yes,food_aggr_no,dog_fixed_yes,dog_fixed_no,instructions) values('$v_firstname','$v_lastname','$v_address','$v_city','$v_state','$v_zip','$v_homephone','$v_cellphone','$v_email','$v_dogname','$v_male','$v_female','$v_dogbreed','$v_dropdate','$v_pickupdate','$v_ppl_aggr_yes','$v_ppl_aggr_no','$v_dog_aggr_yes','$v_dog_aggr_no','$v_food_aggr_yes','$v_food_aggr_no','$v_dog_fixed_yes','$v_dog_fixed_no','$v_instructions')"; mysql_query($query) or die(mysql_error()); echo "Your appointment has been booked, Please confirm the booking by paying your $30 deposit by clicking here link>>"; } ?>

YOU double posted this question. I answered this in the other post…

Basically, you do a where between like this:
select * where x between 1 and 3, y between 8 and 99

Note the comma between the multiple BETWEEN’s… (Do not use another AND to link betweens!)

Hope that helps and please do not double-post…

Sponsor our Newsletter | Privacy Policy | Terms of Service