After i enter data into the email and age threads i get an error saying the not all required fields were entered. Anyone have any ideas? <?php $email = $_POST['email']; $age = $_POST['age']; function addInfo(){ global $conn; $q = "INSERT INTO Info VALUES ('$email', '$age')"; return mysql_query($q,$conn); } $_SESSION['inforesult'] = addInfo($_POST['email'],$_POST['age']); ?> <p>Thank you <b><? echo $uname; ?></b>, your information has been added to the database, you may now <a href="main.php" title="Login">log in</a> </p> <html> <title>Registration Page</title> <body> <h1>Please include additional information</h1> <form action="<?php echo $HTTP_SERVER_VARS['PHP_SELF']; ?>" method="post"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr><td>email:</td><td><input type="text" name="email" maxlength="30"></td></tr> <tr><td>age:</td><td><input type="int" name="age" maxlength="30"></td></tr> <tr><td colspan="2" align="right"><input type="submit" name="subjoin" value="Join!"></td></tr> </table> </form> </body> </html> PHP:
"not all required fields were entered" might be from the columns count in your database table, do you have the ddl of the database? are there more than two columns?
How many fields do u have in your datebase?? If u have only email an age then u can write INSERT INTO info (email , age) VALUES ('$email' , '$age') if not then the error is becouse of you are not inserting any value into some of your fields which is not NULL!!!