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 Link to comment https://forums.phpfreaks.com/topic/128073-solved-help-sql-syntax-error/ 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 Link to comment https://forums.phpfreaks.com/topic/128073-solved-help-sql-syntax-error/#findComment-663228 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 Link to comment https://forums.phpfreaks.com/topic/128073-solved-help-sql-syntax-error/#findComment-663230 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.