mydownfall00 Posted June 10, 2009 Share Posted June 10, 2009 Not sure what this is telling me : myDownfall (this is showing the connection Error with query: Column count doesn't match value count at row 1 Here is my php script.. $username=$_POST['username']; $password=$_POST['password']; $firstname=$_POST['firstname']; $lastname=$_POST['lastname']; $email=$_POST['email']; $age=$_POST['age']; $band=$_POST['band']; $description=$_POST['description']; $query = "INSERT INTO `users`(`username`, `password`, `firstname`, `lastname`, `email`, `age`, `band`, `description`) VALUES ('$username', '$password', '$firstname', '$lastname', '$email', '$age' '$band', '$descriprion')"; $result = mysql_query($query); if (!$result) { $errormessage = mysql_error(); echo "Error with query: " . $errormessage; exit(); } printf ("These values were inserted into the database - %s %s %s", $username, $firstname, $lastname); ?> here is the html side <table border="0" cellpadding="3" cellspacing="3"> <tr> <td valign="top"> <form action="add2.php" method="POST"> Username : </td> <td> <input type="text" class="forms" name="username" size="40" length="40" value="Username"><BR><BR /> </td> </tr> <tr> <td valign="top"> Password : </td> <td><input type="password" class="forms" name="password" size="40" length="40" value=""><BR> <BR> </td> </tr> <tr> <td valign="top"> First Name : </td> <td><input type="text" class="forms" name="firstname" size="40" length="40" value="First Name"><BR> <BR> </td> </tr> <tr> <td valign="top"> Lastname : </td> <td><input type="text" class="forms" name="lastname" size="40" length="40" value="Last Name"><BR> <BR> </td> </tr> <tr> <td valign="top"> Email :</td> <td><input type="text" name="email" size="40" length="40" class="forms" value="Email"><BR> <BR></td></tr> <tr> <td valign="top"> Age : </td> <td><input type="text" class="forms" name="age" size="40" length="40" value="Age"><BR> <BR> </td> </tr> <tr> <td valign="top"> Favorite Band : </td> <td><input type="text" class="forms" name="band" size="40" length="40" value="Favorite Band"><BR> <BR> </td> </tr> <tr> <td valign="top"> Description : </td> <td> <textarea cols="50" rows="8" name="description" class="forms"></textarea> <BR> <BR> </td> </tr> <tr> <td> <input type="submit" name="submit" value="Submit" class="forms"> </form> </td> </tr> </table> and just because.. here is how i have my table setup.. id int( No auto_increment primary key username varchar(25) No password int(10) No firstname varchar(20) No lastname varchar(20) No email varchar(30) No age int(3) No band varchar(20) No description varchar(250) No No is Not Null Any help with what it's doing would be cool.. Quote Link to comment https://forums.phpfreaks.com/topic/161623-solved-sign-up-script-problems/ Share on other sites More sharing options...
Maq Posted June 10, 2009 Share Posted June 10, 2009 Missing a comma after '$age', in your query. Quote Link to comment https://forums.phpfreaks.com/topic/161623-solved-sign-up-script-problems/#findComment-852856 Share on other sites More sharing options...
mydownfall00 Posted June 10, 2009 Author Share Posted June 10, 2009 myDownfall Error with query: Duplicate entry '0' for key 1 I've had this error before, i was playing with my script and trying different thigns and what i missed and i will go into the table and delete the only entry.. but it still doesn't want to work. Quote Link to comment https://forums.phpfreaks.com/topic/161623-solved-sign-up-script-problems/#findComment-852858 Share on other sites More sharing options...
mydownfall00 Posted June 10, 2009 Author Share Posted June 10, 2009 Wow, nevermind.. the comma was the problem.. :-\ i wasted time for that.. thanks anyway.. Quote Link to comment https://forums.phpfreaks.com/topic/161623-solved-sign-up-script-problems/#findComment-852859 Share on other sites More sharing options...
Maq Posted June 10, 2009 Share Posted June 10, 2009 Wow, nevermind.. the comma was the problem.. :-\ i wasted time for that.. thanks anyway.. It's usually the small things. Please mark as solved. Quote Link to comment https://forums.phpfreaks.com/topic/161623-solved-sign-up-script-problems/#findComment-852860 Share on other sites More sharing options...
mydownfall00 Posted June 10, 2009 Author Share Posted June 10, 2009 Wait a second.. In the table it doesnt want to store the password.. its giving me aha.. i got it.. Quote Link to comment https://forums.phpfreaks.com/topic/161623-solved-sign-up-script-problems/#findComment-852861 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.