So I am having a strange problem on live website, and I am not sure what is causing the problem since in datetime field in mysql table sometimes time is mapped and more often it isn't. However date is always mapped.
Code goes like this:
$party_system_id = $this->blabla->addUser($username, 'None', 'None', '',
$email,$promo_code,$distributor_id);
if ($party_system_id!=0){
$loginToken = md5(uniqid(rand(), true));
$params = array(
'sponsorId' => $sponsor_id,
'refferalId' => $referral_id,
'accountType' => $type,
'email' => $email,
'username' => $username,
'password' => md5($password),
'firstName' => 'n/a',
'lastName' => 'n/a',
'expires' => $expiration_date,
'activated' => 1,
'gender' => $gender,
'languageId' => 38,
'onlineStatus'=> 0,
'status' => 5,
'dateAdded' => new Zend_Db_Expr('NOW()'),
'blaId' => $party_system_id,
'loginToken' => $token,
'termsAccepted' => 1
);
return $this->insert($params);
}
And registration is allways fine, but like I said for lot of users insted of: 2012-05-16 10:20:33 I would get: 2012-05-16 00:00:00 and of-course it is not 00:00:00 at the moment of registration :)
I am not sure what can be a problem, mysql, script structure, or Zend_Db_Expr. I also don't have an idea how to properly debug this, but all suggestions are more then welcome :)