mattd8752 Posted January 22, 2007 Share Posted January 22, 2007 I get the following feedback:thisisatestusernamethisisatestregistrationkeythisisatestpassword540ee6cb238b047b425a326bf5cfdcc3thisisatestemailUsername is available...Unknown column 'thisisatestusername' in 'field list'Your account should be registered. Try logging in! Login PageFrom my registration script:[code]<?phpinclude "dbconnect.php"; if(!isset($_POST['register']) || !isset($_POST['regkey']) || !isset($_POST['username']) || !isset($_POST['password']) || !isset($_POST['email'])){?><html><head><title>Registration Form</title></head><body><form method="POST" action="register.php">Username:<input type="text" name="username" size="20"><br>Password:<input type="password" name="password" size="20"><br>Email:<input type="text" name="email" size="20"><br>Registration Key:<input type="text" name="regkey" size="20"> (you need to get a registration key to sign up)<br><input type="submit" value="Submit" name="register"></form></body></html><?php }else{//reg them$username = $_POST['username'];echo $username;$key = $_POST['regkey'];echo $key;$pass = $_POST['password'];echo $pass;$pass = md5($pass);echo $pass;$email = $_POST['email'];echo $email;$found = mysql_result(mysql_query('SELECT count(0) FROM `users` WHERE `username` = "'.$username.'" LIMIT 1'), 0, 0); if ( $found > 0 ){ echo ("Sorry, that username is already taken."); die; }else{echo "Username is available...<br>"; mysql_query("INSERT INTO users (username,password,regkey,email) VALUES(".$username.",".$pass.",".$key.",".$email.")");echo mysql_error(); echo "Your account should be registered. Try logging in! <a href=\"login.php\">Login Page</a>"; } }?>[/code]It is not placing anything in the database and you can probably see the MYSQL error, that is with me writing thisisatest* for every field and submitting, all the data is taken but none is being put into my database. My DB connect DOES WORK, I have a working login script with the same DBconnect page. Quote Link to comment Share on other sites More sharing options...
trq Posted January 23, 2007 Share Posted January 23, 2007 [code=php:0]mysql_query("INSERT INTO users (username,password,regkey,email) VALUES ('$username','$pass','$key','$email')");[/code] 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.