Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

form data failing to submit

Guest
Oct 16, 2009 Oct 16, 2009

I have created a simple form with corresponding database table but I get this error message whenever I submit:

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 'condition, trailer) VALUES ('Steve Tester', 'steve@test.net', '333-333-3333', 's' at line 1

i have checked and rechecked to make sure all the values are identical. Help!

the form is at http://floridaautotransport.org/quote.php

thanks!

TOPICS
Server side applications
684
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 17, 2009 Oct 17, 2009

Until you understand what they mean, MySQL error messages can be mystifying. Unfortunately, simply showing the error message to another person doesn't help much either. However...

What MySQL means when it says "check for the right syntax to use near 'XYZ...'" is that the error is immediately before 'XYZ...'.

To troubleshoot MySQL errors, you need to use echo to display the actual SQL query being submitted to the database. This involves going into Code view and making a quick edit. The following is part of the code for a recordset called getAuthors:

$query_getAuthors = sprintf("SELECT first_name, family_name FROM authors WHERE first_name = %s ORDER BY family_name ASC", GetSQLValueString($colname_getAuthors, "text"));
$getAuthors = mysql_query($query_getAuthors, $connQuery) or die(mysql_error());

To display the actual SQL query, edit it like this:

$query_getAuthors = sprintf("SELECT first_name, family_name FROM authors WHERE first_name = %s ORDER BY family_name ASC", GetSQLValueString($colname_getAuthors, "text"));

echo $query_getAuthors;

exit;

$getAuthors = mysql_query($query_getAuthors, $connQuery) or die(mysql_error());

This displays the SQL query without submitting it to the database. Even if you don't understand the error yourself, copy the SQL query and post it here. Someone should be able to identify the problem.

Obviously, you should use the variable that relates to your recordset instead of $query_getAuthors. It's $query_ followed by the name of the recordset.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 17, 2009 Oct 17, 2009
LATEST

This is the data failing to submit: SELECT * FROM employeelookup 0

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines