JuanRa Posted October 12, 2008 Share Posted October 12, 2008 $mapname = $_POST['name']; $cat = $_POST['category']; $readme = $_POST['readme']; $author = $_POST['author']; $authorlink = $_POST['authorlink']; $release = $_POST['release']; $version = $_POST['version']; $filesize = $_POST['filesize']; $players = $_POST['players']; $timeofday = $_POST['timeofday']; $textures = $_POST['textures']; $weapons = $_POST['weapons']; $theme = $_POST['theme']; $environment = $_POST['environment']; $download = $_POST['download']; $youtube = $_POST['youtube']; $img = $_POST['img']; $img1 = $_POST['img1']; $img2 = $_POST['img2']; $img3 = $_POST['img3']; $readme = nl2br(strip_tags($_POST['readme'],"<b><a><i><u><font color>")); $sql = "INSERT into maps (cat,name,author,readme,release,filesize,players,timeofday,textures,weapons,authorlink,img,img1,img2,img3,version,environment,theme,download,youtube) VALUES('cat','$name','$author','$readme','$release','$filesize','$players','$timeofday','$textures','$weapons','$authorlink','$img','$img1','$img2','$img3','$version','$environment','$theme','$download','$youtube')"; $addmaps = mysql_query($sql) or die(mysql_error()); echo ("<meta http-equiv=\"Refresh\" content=\"1; URL=\"/>Map added successfully! You will now be redirected"); I have been searching and trying to figure out what could be wrong but i just can't someone please help. I get this 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 'release,filesize,players,timeofday,textures,weapons,authorlink,img,img1,img2,img' at line 1 I'm using mysql 5.0 Quote Link to comment Share on other sites More sharing options...
Zane Posted October 12, 2008 Share Posted October 12, 2008 release is a reserved word in MySQL surround every one of your table name in that SQL query with backticks `release`,`filesize`,`players`,`timeofday`,`textures`,`weapons`,`authorlink`....etc etc Quote Link to comment Share on other sites More sharing options...
JuanRa Posted October 12, 2008 Author Share Posted October 12, 2008 wow thanks i didn't know about that much appreciated Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.