Bug #30936 Syntax error
Submitted: 10 Sep 2007 15:19 Modified: 10 Sep 2007 15:33
Reporter: karthik ram Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:MySQL 5.0 OS:Any
Assigned to: CPU Architecture:Any

[10 Sep 2007 15:19] karthik ram

 I am totally new to php and mysql.I connected the page to the database and i am getting an error message whenever i tried to enter the values and it shows an error message.

My script is as follows:

dbi =mysql_connect($dbHost, $dbUser, $dbPass) or die("Error: couldn't connect to database.");
//Select the database we want to use
mysql_select_db($dbName,$dbi) or die("Could not select database");

$group = $_POST["grp"];
$seats = $_POST["seats"];
$room = $_POST["room"];
$building = $_POST["building"];
$buildingid = $_POST["buildingid"];
$type = $_POST["type"];
$typeid = $_POST["typeid"];

//Insert the details into the Database
$sql=("INSERT INTO tbltechen-test (grp, seats, room, building, buildingid, `type`, typeid) VALUES ('$grp','$seats','$room','$building','$buildingid','$type','$typeid')");
$result = mysql_query($sql,$dbi);
echo mysql_error ();

The error message im getting is 
"You have an error in your SQL syntax near '-test (grp, seats, room, building, buildingid, `type`, typeid) VALUES ('','','',' at line 1Your details were not added due to some database problem"

Can anyone help me out pleaseeeeeeeeeeeeee......

How to repeat:
I think type in my script is a SQL keyword.
[10 Sep 2007 15:33] MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.