searls03 Posted May 3, 2011 Share Posted May 3, 2011 can anyone help me find out what is wrong with this query? <?php if(isset($_POST['save'])) { $event = $_POST['event']; $startdate = $_POST['startdate']; $enddate = $_POST['enddate']; $description = $_POST['description']; $location = $_POST['location']; $month = $_POST['month']; $title1 = $_POST['title1']; $title2 = $_POST['title2']; $title3 = $_POST['title3']; $title4 = $_POST['title4']; $title5 = $_POST['title5']; $title6 = $_POST['title6']; $title7 = $_POST['title7']; $title8 = $_POST['title8']; $date1 = $_POST['date1']; $date2 = $_POST['date2']; $date3 = $_POST['date3']; $date4 = $_POST['date4']; $date5 = $_POST['date5']; $date6 = $_POST['date6']; $date7 = $_POST['date7']; $date8 = $_POST['date8']; $subevent1 = $_POST['subevent1']; $subevent2 = $_POST['subevent2']; $subevent3 = $_POST['subevent3']; $subevent4 = $_POST['subevent4']; $subevent5 = $_POST['subevent5']; $subevent6 = $_POST['subevent5']; $subevent7 = $_POST['subevent6']; $subevent8 = $_POST['subevent7']; $price1 = $_POST['price1']; $price2 = $_POST['price2']; $price3 = $_POST['price3']; $price4 = $_POST['price4']; $price5 = $_POST['price5']; $price6 = $_POST['price6']; $price7 = $_POST['price7']; $price8 = $_POST['price8']; $month2 = $_POST['month2']; $month_num = $_POST['month_num']; $day = $_POST['day']; $year = $_POST['year']; $q = "UPDATE Registration Set event='$event', startdate='$startdate', enddate='$enddate', description='$description', location='$location', month='$month, title1='$title1', title2='$title2', title3='$title3', title4='$title4', title5='$title5', title6='$title6', title7='$title7', title8='$title8', date1='$date1', date2='$date2', date3='$date3', date4='$date4', date5='$date5', date6='$date6', date7='$date7', date8='$date8', subevent1='$subevent1', subevent2='$subevent2', subevent3='$subevent3', subevent4='$subevent4', subevent5='$subevent5', subevent6='$subevent6', subevent7='$subevent7', subevent8='$subevent8', price1='$price1', price2='$price2', price3='$price3', price4='$price4', price5='$price5', price6='$price6', price7='$price7', price8='$price8', month2='$month2', shutoff='$shutoff', month_num='$month_num', day='$day', year='$year' Where eventid='eventid'"; $sql = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error());} ?> errror is You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Campout', title2='', title3='', title4='', title5='', title6='', title7='', titl' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/235452-error/ Share on other sites More sharing options...
mikosiko Posted May 3, 2011 Share Posted May 3, 2011 the posted code seems no to be the one causing the error... is nothing called "Campout" on it Quote Link to comment https://forums.phpfreaks.com/topic/235452-error/#findComment-1210099 Share on other sites More sharing options...
searls03 Posted May 3, 2011 Author Share Posted May 3, 2011 I found it, there was no closing ' after month....... Quote Link to comment https://forums.phpfreaks.com/topic/235452-error/#findComment-1210100 Share on other sites More sharing options...
Maq Posted May 3, 2011 Share Posted May 3, 2011 Also, I don't think you want: Where eventid='eventid' Quote Link to comment https://forums.phpfreaks.com/topic/235452-error/#findComment-1210105 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.