This is the way it looks right now:
function sql_addBanner($subcat,$href,$src,$target,$width,$height,$adwords,$adclass,$anchor,$alt,$bannercat){
global $link;
$table = $subcat . "banner";
$table = mysql_escape_string($table);
$href = mysql_escape_string($href);
$src = mysql_escape_string($src);
$target = mysql_escape_string($target);
$adwords = mysql_escape_string($adwords);
$anchor = mysql_escape_string($anchor);
$alt = mysql_escape_string($alt);
$bannercat = mysql_escape_string($bannercat);
$sqladd = "INSERT INTO " . $table . " (id,href,src,target,width,height,adwords,adclass,anchor,alt,bannercat) VALUES(NULL."','".$href."','".$src."','".$target."',".$width.",".$height.", '".$adwords."','".$adclass."','".$anchor."','".$alt."','".$bannercat."')";
$q = mysql_query($sqladd,$link);
if($q){output_html('Banner has been added'); }
else{error('unable to complete request!'); }
exit;
}
I also tried putting the quotes around the comma that goes just after the null. (I don't think there was any there before). It still continues to give me the same message error.
The reason why I thought perhaps the 'null' might be the problem is that I have used this INSERT INTO code before with other scripts and it worked fine at other times. The only thing that was different this time was the null and the use of the variable $table to insert the mysql table name.
The id value is intended to be auto-incrementing.