php - time() safe in mysql doesnt work -


i have little problem safe current time in mysql.

the table have 2 rows:

  1. timestamp - on update current_timestamp
  2. 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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -