Gnub Posted April 28, 2007 Share Posted April 28, 2007 Im a little reluctant on posting sql problems on here, because they are small, but when im in a little bit of a deadline, a quick solution is better Ok, i've pretty much copied the SQL from one query to another, changing where needed. Now, im getting a... "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 'Passenger, Mobile Number, NoAdults, NoChild, NoInfant, HotelName" I've added a few lines before, incase it's something from there, but i've not got any problems with that part, as it's doing what's needed. Mobile Number, No Adults, No Child, and No Infant are as INT types on the DB. SQL Query: if($sent) {print "Your mail was sent successfully"; } else {print "We encountered an error sending your mail"; } $sql = "INSERT INTO `Majorca_Transfers` (BookingRef, Lead Passenger, Mobile Number, NoAdults, NoChild, NoInfant, HotelName, Resort, ShuttleArea, DepDate, FromAPT, ToAPT, FltNumber, ArrivalTime, DepDateFrom, FromAPTF, ToAPTF, FltNumberT, DepartureTime) VALUES ('$OurRef', '$Lead', $Mobile, $Adult, $Child, $Infant, '$Hotel', '$Resort', '$Area', '$DateFrom', '$FromAPT1', '$ToAPT1', '$FLTN1', '$ARRTIME1', '$DateFrom', '$FromAPT2', '$ToAPT2', '$FLTN2', '$ARRTIME2')"; $sql2 = "Select * From `Majorca_Transfers` Where `BookingRef` = $OurRef"; Thanks in advance for pointing out my error. Gnub. Link to comment https://forums.phpfreaks.com/topic/49079-solved-small-sql-help/ Share on other sites More sharing options...
AndyB Posted April 28, 2007 Share Posted April 28, 2007 I suspect it's the spaces in field names that's causing the problem. Those really would be best if you used an _underscore_ in place of the space (or no space at all) Link to comment https://forums.phpfreaks.com/topic/49079-solved-small-sql-help/#findComment-240449 Share on other sites More sharing options...
Gnub Posted April 28, 2007 Author Share Posted April 28, 2007 Thanks for the quick response AB! I've not had any problems with space in previous queries, so i was reluctant to think it was something to do with that. but thanks ! Gnub Link to comment https://forums.phpfreaks.com/topic/49079-solved-small-sql-help/#findComment-240460 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.