Jump to content

Insert Failing.


Fuzzy Logic

Recommended Posts

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.