The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
SQL error, tried to figure it out, but not sure why it isn't working
Okay here is the table layout
id int(8) No 0 name varchar(50) Yes NULL dob varchar(50) Yes NULL height varchar(50) Yes NULL weight int(3) Yes 0 jersey varchar(50) Yes NULL from varchar(50) Yes NULL position varchar(50) Yes NULL teamname varchar(50) Yes NULL sport varchar(25) Yes NULL Here is the mysql query Code:
$query = "INSERT INTO add_temp_player (id, name, height, weight, jersey, from, position, teamname, sport) VALUES ($_POST[id2],'$_POST[name]','$_POST[height]',$_POST[weight],'$_POST[number]','$_POST[from]','$_POST[position]','$_POST[team]','$_POST[sport]')"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); INSERT INTO add_temp_player (id, name, height, weight, jersey, from, position, teamname, sport) VALUES (59,'Larry Hughes',' 6-5',184,' 32',' St. Louis',' G','cavaliers','') Here is the error Query failed: 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 'from, position, teamname, sport) VALUES (591,'Luis Alicea','',0 The database is connected, because the other queries, on the same page work. Which looks right to me. I am not sure why it isn't working, can anyone help me out. Thanks |
#2
|
||||
|
||||
Code:
[high]from[/high], position, teamname, i suggest to rename the field via phpmyadmin and change the query |
#3
|
||||
|
||||
Yeah, you can't use keywords.
On a side note, I notice some of the data has leading spaces. You might want to trim() your data before entry to remove leading and trailing spaces. They are usualy the result of copy/paste data entry into forms. |
#4
|
|||
|
|||
Thanks, I will add that, I noticed that as well, just hadn't done it yet.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|