i have this script:
and its giving me this error:PHP Code:<?
//connect to database
$link= mysql_connect ("localhost", "root", "godzilla");
mysql_select_db ("CSI");
//build query
$query= "INSERT INTO tbl_articles (issue, authorID, catID, subcat, title, subhead1, subhead2, specs, body)
VALUES ('$issue', $authorID, $catID, '$subcat', '$title', '$subhead1', '$subhead2', '$specs', '$body')";
$result = mysql_query ($query);
if (!$result) {
print (mysql_error());
}else{
print ("data added succesfully");
}
mysql_close ($link);
?>
You have an error in your SQL syntax near ' , '', '', '', '', '', '')' at line 2
I cant figure out what it is, can anyone help me out?




Sorry) The "values" method works but is more difficult to look at and debug. The way I wrote it I know has good syntax, so if you get errors, check your field names or otherwise. 

i hate magic_quotes. see the section magic_quotes, addslashes(), and stripslashes() in my 


Bookmarks