Arrgh. I've been staring at this forever, trying to figure it out, and it's just not working. I'm getting the following error:
You have an error in your SQL syntax near ''categoryid, character') VALUES ('1', 'dsafds')' at line 1
This is not the entire function, just the relevant part:
if($submit){
mysql_query("INSERT INTO ".$prefix."_fanfiction_characters (categoryid, character) VALUES ('$categoryid', '$character')") or (die(mysql_error()));
echo "$categoryid, $character";
echo "Your character has been added.";
If I remove the or die statement, than the echoing of my variables works fine, so the data is getting sent through when submit is pressed (didn't include that part of my code, but $submit is defined elsewhere). Do you see anything glaringly wrong with my sql query? Here's the table that I'm trying to insert into:
Field Type Attributes Null Default Extra
characterid int(11) No auto_increment
categoryid int(11) No 1
character varchar(30) No