I am trying to insert a record into my database. here is my php code for doing that:
mysql_query("INSERT INTO answers(answer)
VALUES('answer')");
if(mysql_affected_rows() > 0) {
echo "Reply successful!";
} else {
echo "We were not able to add your reply.";
exit();
}
i made sure that i am connected to my db. i tried this on another page where i knew my sql would run, and it still didn’t insert the record…
add
echo mysql_error();to see the problem