Error with Mysql query...need help
Posted: Sat Feb 03, 2007 6:37 pm
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm working on a small CMS and so far I am just having a few errors with the "insert" query, I've changed it several times and went to many sites trying to figure out the problem....any suggestions?
Here's the error message:
[quote]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 'desc, path, dwls) VALUES ('tt' ,'1' ,'test' ,'PHP' ,'test file' ,'http://www.dar' at line 1[/quote]
Here is the code:Code: Select all
if(isset($_POST['add'])){
$path=$_POST['path'];
$name=$_POST['name'];
$act=$_POST['act'];
$desc=$_POST['desc'];
$fid=$_POST['fid'];
$type=$_POST['type'];
$dwls=0;
$query="INSERT INTO dwl_files (fid, act, name, type, desc, path, dwls) VALUES ('$fid' ,'$act' ,'$name' ,'$type' ,'$desc' ,'$path' ,'$dwls')";
$final=mysql_query($query)or die('Query Failed:'.mysql_error());
header("Location: dwl.php?action=none");
}feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]