outatime15 — 2012-05-12T22:19:47-04:00 — #1
I am getting this error on my results page for a form:
Error: 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 'references, insurance, namedate) VALUES ('test','test','test','t
This is my code:
$con = mysql_connect("mysql","*****","*****");
die('Could not connect: ' . mysql_error());
}mysql_select_db("dasher", $con);$sql="INSERT INTO vendor (cname, maddress, paddress, supplies, bphone, cphone, fax, email, conname, capacity, contactcellphone, statetax, fedtax, ssn, lengthbusiness, license, residence, references, insurance, namedate)
die('Error: ' . mysql_error());
echo "Your application is being reviewed.";mysql_close($con)
I'm not seeing any problems. Am I missing something?
mittineague — 2012-05-12T22:48:05-04:00 — #2
"references" is a reserved word. You'll need to change that or put it in backticks.
outatime15 — 2012-05-14T02:02:29-04:00 — #3
That was it! Thanks man! I have another question. Would it be possible to export the table into an organized form so that it isn't just rows of data? This would be so my client can easily look over the information submitted.
guelphdad — 2012-05-14T10:04:21-04:00 — #4
how is rows of data not organized already? You'd have to clarify what you want your client to look at for us to decide how to answer that question.
outatime15 — 2012-05-14T12:15:11-04:00 — #5
What I'm talking about is a proper form like you would have on a print out. My client gave me a print out of their form, and I made a form on the website. So could they be able to see an export that looks similar to their form that's on paper? So that they maybe could print that out.
mittineague — 2012-05-14T14:43:59-04:00 — #6
You can export database content in a few formats, but they are for backing up or moving, not really for human consumption, unless maybe if you like reading raw CSV
What you want is to put together a SELECT query to get what you want and have some sort of script format it.
Although MySQL can allow for some fine tuning, it really depends mostly on what language you're working with.
outatime15 — 2012-05-14T21:38:52-04:00 — #7
I'll give that a shot. Thanks!