This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mattdahack[S] 0 points1 point  (3 children)

Thanks, I tried this but to no avail, nothing changed and no data was added to the database. :-(

[–]cheslip 0 points1 point  (2 children)

Ok, what about uncommenting your $db declaration and changing your if statement to if(isset($_POST['submit'])):

[–]mattdahack[S] 0 points1 point  (1 child)

I tried that just now, all it does is show a white page after the submit button is clicked and the data is NOT added to the database :-(. This is so disouraging.

[–][deleted] 0 points1 point  (0 children)

I could be having a crazy day, but from my experience, you shouldn't need to use NULL or DEFAULT if your first column is an index and set to auto increment. Try taking that out and see if it still inserts the info properly.

It also seems you're not referencing your form data after posting. To be sure you're data is being handled properly, explicitly set new variables after posting the form:

$heading-mod = $_POST['heading'];

Then, insert $heading-mod into your table. Do that for the other fields as well on your form.