amarkabove Posted February 29, 2008 Share Posted February 29, 2008 here is the php code that is giving me the error. i am using mysql 5 and php5 $db->query('INSERT INTO Business (Primary, Company, ConName, Street, Mailing, City, State, Zip, Phone, AltNum, Fax, Email, Website, Promo, ZipCodes, ConPhone, ConAlt, ConFax, ConEmail, Trim, Moving, Fert, Planting, Health, Removal, Lightning, Cable, Grinding, Root, Fire, Beetle, Disposal, Affiliations, Insured, InsCompany, WebPage, WebName, Advertisement, Agree, Signed, Dated, Amount, Card, CardNum, ExDate, CardName, BillAddress, CityState, CardZip, Security, Membership) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', array($primary_ID,$_POST['CompanyName'],$_POST['CompanyContact'],$_POST['StreetAddress'],$_POST['MailAddress'], $_POST['City'], $_POST['State'],$_POST['Zip'],$_POST['PhoneNumber'],$_POST['AltNumber'],$_POST['Fax'],$_POST['Email'],$_POST['Website'], $_POST['PromotionalCode'],$_POST['zipcoderequest'],$_POST['CompanyPreference'],$_POST['AltPreference'], $_POST['FaxPreference'],$_POST['electronicmailPreference'],$Trimming,$Moving,$Fertilization,$Planting,$Health,$Removal, $Lightning,$Cabling,$Stump,$Root,$Fire,$Beetle,$Byproducts,$_POST['additionalinfo'],$insuranceyes,$_POST['Insurance'], $webpageyes,$_POST['Webpage'],$_POST['Referredby'],$agree,$_POST['Signed'],$_POST['Date'],$_POST['TotalAmount'], $_POST['CreditCard'],$_POST['CardNumber'],$_POST['ExpDate'],$_POST['CardholderName'],$_POST['Street'], $_POST['CityState'], $_POST['CardZip'],$_POST['SecurityCode'],$_POST['Application'])); Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 29, 2008 Share Posted February 29, 2008 First thing I would try is wrapping your fieldnames in backticks. Like so: INSERT INTO `Business` (`Primary`, `Company`, `ConName`, ...etc Also, is there more to the error message then just syntax error? Quote Link to comment Share on other sites More sharing options...
fenway Posted February 29, 2008 Share Posted February 29, 2008 I'd like to see the mysql error message. And it looks like you really need to normalize that table! Quote Link to comment Share on other sites More sharing options...
amarkabove Posted February 29, 2008 Author Share Posted February 29, 2008 the back ticks worked. thanks Quote Link to comment 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.