Hello, I'm trying to import an .sql file to my arcade website and I'm getting some strange errors. Can someone who knows SQL look at this line of code and tell me if there is something wrong with it? Thanks! INSERT INTO `games` ('gameid', 'gametitle', 'gamedesc', 'gamekeywords', 'gamefile', 'gameheight', 'gamewidth', 'category', 'timesplayed', 'totalvotes', 'totalvotepoints', 'rating', 'gameicon', 'gamestatus', 'playedtoday', 'gamelocation', 'iconlocation', 'instructions', 'filetype', 'customcode') VALUES (2,'12 Many','The screen flashes quickly and it ask you how many stars you seen. Can get quite challenging.','12 Many','1221.swf',360,480,1,38,0,0,0.00,'1221.png',1,0,0,0,'',1,''), Anything look strange (except the bad grammer, lol)?
I'm guessing it's an extended insert, and the values bit repeats over and over. this should be when listing the fields you are inserting into you use backticks ` rather than single quotes. when listing the values for the fields you use double or single quotes (the singles you have are fine.
UGH... Tried replacing them like you said and here's what I get: "Error SQL query: INSERT INTO `games` ( `gameid` , `gametitle` , `gamedesc` , `gamekeywords` , `gamefile` , `gameheight` , `gamewidth` , `category` , `timesplayed` , `totalvotes` , `totalvotepoints` , `rating` , `gameicon` , `gamestatus` , `playedtoday` , `gamelocation` , `iconlocation` , `instructions` , `filetype` , `customcode` ) VALUES ( 1, '12 Holes of X-Mas', "'Pick your putter and go out to putt a hole in one.Move the ball to where you want it then click,move your mouse according to the arrow then click to shoot the ball, and play all twelve holes'", '12 Holes of X-Mas', 'f-218.swf', 400, 525, 1, 7236, 0, 0, 5.00, 'f-218.png', 1, 0, 0, 0, '', 1, '' ) , MySQL said: #1064 - 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 '' at line 1"
In phpMyAdmin look at the structure of the table and see if it has a field with "auto increment" but you error is here I think. You have two lots of quotes around the description. Do you want to paste your script with [ code ] tags around it?
try this: 1. remove the last comma in your statement 2. remove the backticks INSERT INTO games (gameid, gametitle, gamedesc, gamekeywords, gamefile, gameheight, gamewidth, category, timesplayed, totalvotes, totalvotepoints, rating, gameicon, gamestatus, playedtoday, gamelocation, iconlocation, instructions, filetype, customcode) VALUES (2,'12 Many','The screen flashes quickly and it ask you how many stars you seen. Can get quite challenging.','12 Many','1221.swf',360,480,1,38,0,0,0.00,'1221.png',1,0,0,0,'',1,'') Code (markup):
Here's the script I'm trying to get to work - So far, none of the suggestions have worked I really appreciate all the ongoing help though! www.seocraze.com/phpas.zip
Thanks guys, but still getting: Error SQL query: INSERT INTO `games` ( 'gameid', 'gametitle', 'gamedesc', 'gamekeywords', 'gamefile', 'gameheight', 'gamewidth', 'category', 'timesplayed', 'totalvotes', 'totalvotepoints', 'rating', 'gameicon', 'gamestatus', 'playedtoday', 'gamelocation', 'iconlocation', 'instructions', 'filetype', 'customcode' ) VALUES ( 1, '12 Holes of X-Mas', "'Pick your putter and go out to putt a hole in one.Move the ball to where you want it then click,move your mouse according to the arrow then click to shoot the ball, and play all twelve holes'", '12 Holes of X-Mas', 'f-218.swf', 400, 525, 1, 7236, 0, 0, 5.00, 'f-218.png', 1, 0, 0, 0, '', 1, '' ); MySQL said: #1064 - 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 ''gameid', 'gametitle', 'gamedesc', 'gamekeywords', 'gamefile', I give up, maybe its something wrong with Godaddy.
Nope, don't give up but you've put single quotes back in where they should be backticks or nothing (as per daboss's recommendation)
Yeah, tried that too. You guys seem to know what you're talking about. I really think it must be something I'm doing wrong to import it or something. Should be a 2 sec. job according to the guy on here I bought it from. Oh well.
what is the " character doing here - in bold red? try this: INSERT INTO games ( gameid, gametitle, gamedesc, gamekeywords, gamefile, gameheight, gamewidth, category, timesplayed, totalvotes, totalvotepoints, rating, gameicon, gamestatus, playedtoday, gamelocation, iconlocation, instructions, filetype, customcode ) VALUES ( 1, '12 Holes of X-Mas', 'Pick your putter and go out to putt a hole in one.Move the ball to where you want it then click,move your mouse according to the arrow then click to shoot the ball, and play all twelve holes'", '12 Holes of X-Mas', 'f-218.swf', 400, 525, 1, 7236, 0, 0, 5.00, 'f-218.png', 1, 0, 0, 0, '', 1, '' ); Code (markup):