Home > php_mysql > MySQL insert date

MySQL insert date

PHP:
  1. $add2h = time() + (7 * 60 * 60);
  2. $dt=date("Y-m-d H:i:s", $add2h);
  3. $time = $dt;
  4.  
  5. $query = "INSERT INTO slovarji (id, language, geslo, time)
  6. VALUES ('', '$language', '$geslo', '$time')";
  7.  
  8. $results = mysql_query($query) or die
  9. ("Could not execute query : $query." . mysql_error());

Categories: php_mysql Tags:
  1. No comments yet.
  1. No trackbacks yet.
0 pages viewed, 0 today
0 visits, 0 today
FireStats icon Powered by FireStats