MrFish Posted June 25, 2009 Report Share Posted June 25, 2009 (edited) I have a working registration form but I'm trying to add a date of registration column. I'm using the date() function and when I echo it out it looks fine but when I try to save it to my mysql database it doesn't work. Note that I've tried it 2 ways. I've first tried it by setting it to a variable then by putting it directly into the query. Either way, it still doesn't save correctly. $query = 'INSERT INTO users VALUES("' . $id . '", "' . $username . '", "' . $password . '", "' . $email . '", "' . $server . '", "' . $ign . '", "' . date("m-d-y") . '", "' . $ip . '")'; mysql_select_db("b17_3648160_sitedb", $con) or die(mysql_error()); mysql_query($query); $affected = mysql_affected_rows(); EDIT:Figured it out. That was stupid of me; instead of being m-d-y it should have been y-m-d. Edited June 25, 2009 by MrFish Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now