Fuzzy Logic Posted November 29, 2009 Share Posted November 29, 2009 Hey, I am making a Sign up page for a website, but the insert query into the Database does not seem to work, it returns no errors, just simply does not work. $insert_user = mysql_query("INSERT INTO users (id, username, gender, firstname,lastname, email, password, ipaddress, energy, verifycode, verified, referrer) VALUES ('', '$username','$gender','$firstname','$lastname', '$email', '$password', '$ip', '150', '$verifycode', 'N', '$refferer')"); All the Vars are pre defined. Link to comment https://forums.phpfreaks.com/topic/183285-insert-failing/ Share on other sites More sharing options...
FaT3oYCG Posted November 29, 2009 Share Posted November 29, 2009 try $insert_user = mysql_query('INSERT INTO users VALUES("0", "' . $username . '","' . $gender . '","' . $firstname . '","' . $lastname . '", "' . $email . '", "' . $password . '", "' . $ip . '", "150", "' . $verifycode . '", "N", "' . $refferer . '")'); you may also need to define the connection to be used. Link to comment https://forums.phpfreaks.com/topic/183285-insert-failing/#findComment-967388 Share on other sites More sharing options...
Fuzzy Logic Posted November 29, 2009 Author Share Posted November 29, 2009 try $insert_user = mysql_query('INSERT INTO users VALUES("0", "' . $username . '","' . $gender . '","' . $firstname . '","' . $lastname . '", "' . $email . '", "' . $password . '", "' . $ip . '", "150", "' . $verifycode . '", "N", "' . $refferer . '")'); you may also need to define the connection to be used. That wont know where to insert all the values though will it? Link to comment https://forums.phpfreaks.com/topic/183285-insert-failing/#findComment-967393 Share on other sites More sharing options...
FaT3oYCG Posted November 29, 2009 Share Posted November 29, 2009 well if you are simply inserting your values into all of the fields in order then it should be fine, if not you can put the first set of values (the column names) back in and test it again, if it doesnt owrk it is most likley another problem, try putting or die(mysql_error()) at the end before the ; and see if an error is output. Link to comment https://forums.phpfreaks.com/topic/183285-insert-failing/#findComment-967396 Share on other sites More sharing options...
Fuzzy Logic Posted November 29, 2009 Author Share Posted November 29, 2009 :'( I was missing a field in the database, Sorry Guys =( Works all good now. Your code and help, aided me in finding this =) Big thanks =) Link to comment https://forums.phpfreaks.com/topic/183285-insert-failing/#findComment-967403 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.