Now I've used this snippet of code, but this time its giving me an error and I can't seem to find out. Here is my query:
$title = trim($_POST['title']);
$desc = trim($_POST['description']);
$img = trim($_POST['imgsrc']);
$edate = trim($_POST['edate']);
$timeh = trim($_POST['timeh']);
$timem = trim($_POST['timem']);
$timez = trim($_POST['timez']);
$cic =$_POST['cic'];
//Query
$sql = sprintf("INSERT INTO jos_events (NAME, IMG, DESC, DATE, TIMEH, TIMEM, TIMEZ, CIC) VALUES('%s', '%s', '%s', '%s', '%s', '%s', '%s')",
mysql_real_escape_string($title, $con),
mysql_real_escape_string($img, $con),
mysql_real_escape_string($desc, $con),
mysql_real_escape_string($edate, $con),
mysql_real_escape_string($timeh, $con),
mysql_real_escape_string($timem, $con),
mysql_real_escape_string($timez, $con),
mysql_real_escape_string($cic, $con));
When I mysql_query it it says there is an error in the sprintf syntax. I can't find it for the life of me. Here are my values for the above values
"Test",
"www.blah.com"
"This is a test",
"03/10/08",
"00",
"15",
"Z",
"Michael Hodge (961044)"
Now here is what i've done to test this myself. I've echoed each of those variables and its outputting the text box inputs for each thing. So its acutally submitting to the script. I've tried taking out the "Michael Hodge (961044)" because I thought maybe the parenthisis were throwing it off, but still same thing. i've compared the syntax to another script that submits into a similar table, and i've compared the two and coulden't find anything. lol. Its probally some stupid comma or something somewhere that I can't see.
-Mike