Jump to content

[SOLVED] Help! SQL syntax Error


JuanRa

Recommended Posts

$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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.