I'm currently trying to code a very basic blog/content management system, and have two tables set up, one for an FAQ and one for the blog, unsurprisingly named "faq" and "blog" respectively.
The faq table has fields named 'id', 'question', 'from' and 'answer', and the blog table has 'id','date','heading' and 'entry'.
I can add entries into the blog with the following PHP/SQL (the code to get the variables does work: I tested earlier by echo-ing them before this code chunk):
Code: Select all
<?php mysql_query("INSERT INTO blog (id,date,heading,entry) VALUES('',NOW(),'$heading','$entry')"); ?>Code: Select all
<?php mysql_query("INSERT INTO faq (id,from,question,answer) VALUES('','$from','$question','$answer')"); ?>It's probably such an obvious mistake, but I have not been at this PHP malarky for long. I did search through both manuals to no avail. Can anyone help?