php - time() safe in mysql doesnt work -
i have little problem safe current time in mysql.
the table have 2 rows:
- timestamp - on update current_timestamp
- a php file
here code:
$stamp = time(); if (mysqli_connect_errno() == 0){ $sql = "update xy set stamp = '$stamp' id = '$id'"; $erg = $db->query($sql); }
i have copy files server 1 server 2, , doesnt work on new server.
since, not providing errors, going assume works. use mysql's now()
function ? or curtime()
, utc_timestamp()
$sql = "update xy set stamp = now() id = '$id'";
or, use error handler or die(sprintf("[%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()));
Comments
Post a Comment