Problem inserting Unix Time

I am trying to insert a Unix Time into my database and this code is not working…


	$q2 = "UPDATE member
			SET logged_in=?,
				last_activity=time(),
				updated_on=NOW()
			WHERE id=?
			LIMIT 1";

			// Prepare statement.
			$stmt2 = mysqli_prepare($dbc, $q2);

			// Bind variables to query.
			mysqli_stmt_bind_param($stmt2, 'si', $loggedIn, $memberID);

What am I doing wrong?

Debbie

This appears to have fixed things…


	$q2 = "UPDATE member
			SET logged_in=?,
				last_activity=UNIX_TIMESTAMP(now()),
				updated_on=now()
			WHERE id=?
			LIMIT 1";

Thanks,

Debbie

why would you use unix epoch times for last activity, and datetimes for updated_on?

stick to DATETIME for both

and this should have been part of your other thread