Jump to content

Crazy Error w/MySQL


cverzonilla

Recommended Posts

"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 '1824 (text1) VALUES ('helloo')' at line 1"I'm getting the above Error when using the script below. I don't understand. I'm trying to use a form to insert data on my "any" table column "1". The code is correct. When I switch to another table on my database it works but on my "any" table it doesn't.(along with 4 other tables). Two out of six tables work. I don't get it. I've been trying to fix it for hours. Can anyone help?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><style type="text/css"><!--body {background-color: #FFFFBF;}--></style></head><body><?php$con = mysql_connect("mysql","cverzonilla","******");if (!$con){die('Could not connect: ' . mysql_error());}mysql_select_db("my_db", $con);$sql="INSERT INTO any (1)VALUES('$_POST[comment]')";if (!mysql_query($sql,$con)){die('Error: ' . mysql_error());}echo "Thank you";mysql_close($con)?></body>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...