CircularStopSign Posted August 23, 2006 Share Posted August 23, 2006 alright, this is really starting to frustrate me... now it says "Column count doesn't match value count at row 1" when i try to registerthis is my regiser.php:[code]<?$first_name = $_POST['first_name'];$last_name = $_POST['last_name'];$email_address = $_POST['email_address'];$password = $_POST['password'];$repassword = $_POST['repassword'];$first_name = stripslashes($first_name);$last_name = stripslashes($last_name);$email_address = stripslashes($email_address);$password = stripslashes($password);$repassword = stripslashes($repassword);if((!$first_name) || (!$last_name) || (!$email_address)){ echo 'You did not submit the following required information! <br />'; if(!$first_name){ echo "First Name is a required field. Please enter it below.<br />"; } if(!$last_name){ echo "Last Name is a required field. Please enter it below.<br />"; } if(!$email_address){ echo "Email Address is a required field. Please enter it below.<br />"; } if(!$password==repassword){ echo "Passwords are not the same.<br />"; } include 'join_form.html'; exit();} # does this user already exist in the database? lets check for that now... $sql_email_check = mysql_query("SELECT email_address FROM users WHERE email_address='$email_address'");$email_check = mysql_num_rows($sql_email_check); if($email_check > 0){ echo "<strong>Your email address has already been used by another member in our database. Please use a different Email address!"; unset($email_address); include 'join_form.html'; exit();} $sql = mysql_query("INSERT INTO users (first_name, last_name, email_address, password, signup_date, decrypted_password) VALUES('$first_name', '$last_name', '$email_address', '$db_password',now())") or die (mysql_error());if(!$sql){ echo 'There has been an error creating your account. Please contact the webmaster.';} else { $userid = mysql_insert_id(); // Let's mail the user! $subject = "Your Membership at mywebsite.com"; $message = "Dear $first_name $last_name, You are now registered at our website, http://www.mywebsite.com! To activate your membership, please login here: http://www.patall8.100webspace.net/login_form.html Once you activate your membership, you will be able to login with the following information: Password: $password Please keep this username and password in a location that is easily accessible by you. Thanks! Pat This is an automated response, please do not reply!"; mail($email_address, $subject, $message, "From: <mr.monicaclinton@gmail.com@>\nX-Mailer: PHP/" . phpversion()); echo 'Your membership information has been mailed to your email address! Please check it and follow the directions!';}?> [/code]and my mySQL query contains:useridfirst_namelast_nameemail_addresspasswordsignup_dateactivateddecrypted_passwordsorry for asking for so much help but ive been trying to figure it out for a couple hours now Quote Link to comment Share on other sites More sharing options...
Barand Posted August 23, 2006 Share Posted August 23, 2006 [quote]$sql = mysql_query("INSERT INTO users (first_name, last_name, email_address, password, signup_date, decrypted_password) VALUES('$first_name', '$last_name', '$email_address', '$db_password',now())") or die (mysql_error());[/quote]Count the column names in(first_name, last_name, email_address, password, signup_date, decrypted_password)then count the values in('$first_name', '$last_name', '$email_address', '$db_password', now()) Quote Link to comment Share on other sites More sharing options...
CircularStopSign Posted August 23, 2006 Author Share Posted August 23, 2006 oh... i understand now.. but i dont know how to fix it? Quote Link to comment Share on other sites More sharing options...
Barand Posted August 23, 2006 Share Posted August 23, 2006 Supply a value for decrypted_password Quote Link to comment 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.