Aug. 25th, 2006

theweaselking: (Default)
So, I have this PHP code, talking to an SQL database.

The first part creates a text box with a button. When you put something in the box and click the button, it inserts it into an SQL database. The second half, after the form, reads all entries in that SQL database and displays them.

The second part works perfectly.
The first part fails with absolutely no errors - it just never adds anything to the table.

This example is RIGHT out of the book, literally.

Any PHP geeks out there who can tell me what the hell I'm doing wrong?

And yes, I've munged the brackets. Setting those back to angles is trivial. Making Livejournal obey a PRE tag is not trivial.

Code )
EDIT: I've found the problem, I think. $PHP_SELF is not working. Now I just need to fix it...
EDIT THE SEQUEL: Fixed that, but still can't submit data. At least I'm getting an error, now.
EDIT PART THREE: ELECTRIC BOOGALOO: Fixed. The problem is that modern PHP can't just read comments submitted through the form by default, and you need to use $_REQUEST("comment") to grab the data that's fed into the form from a form named "comment"
theweaselking: (Default)


Click for more!

Profile

theweaselking: (Default)theweaselking
Page generated Jul. 22nd, 2025 11:38 am