Jump to content

Date() Won't Save Corrrectly To My Mysql Database. (fixed)


MrFish

Recommended Posts

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.badregister.png

$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.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...