No worries. There's a lot of code in this one thread:)
Still getting index error when I made that change though:( All indexes are bad. Is there somewhere I need to be defining an index? In PHPmyAdmin there is but which field should I make my index? I actually tried to make the incrementing number (the one I'm using as primary key) as my index but it would not let me do both of them for that one value.
Input from form is not going into mysql table
Moderator: General Moderators
-
lilpenguin
- Forum Newbie
- Posts: 18
- Joined: Sun Sep 19, 2010 7:06 pm
Re: Input from form is not going into mysql table
No, you are misinterpreting "index". It is NOT referring to indexing fields in your table. The "index" the error message is referring to is the ARRAY INDEX of the $_POST array. What should be in the $_POST array when you submit the form should look like this: there should be 7 array elements, like $_POST['username'] (which should contain the value entered in the 'username' form element), etc. The 'username' part is called the array index.lilpenguin wrote:No worries. There's a lot of code in this one thread:)
Still getting index error when I made that change though:( All indexes are bad. Is there somewhere I need to be defining an index? In PHPmyAdmin there is but which field should I make my index? I actually tried to make the incrementing number (the one I'm using as primary key) as my index but it would not let me do both of them for that one value.
If you added the value= statements in your <select> element and you are still getting that error, something else is wrong with your form, although I don't see what it might be. I would do this:
Create a debug script, you might call it formdebug.php, with only the following code:
Code: Select all
<?php
echo "Name = ".$_POST['name']<br>";
echo "UserName = ".$_POST['username']<br>";
echo "Email= ".$_POST['email']<br>";
?>What you have to isolate is whether the form is or is not properly creating the $_POST array for the handler script to read.