title: Timestamp to get current time/date
body: <p>I need simple code using PHP to get the current date/time using TIMESTAMP and insert this into a database. </p>
  
  <p>I have a field called "ArrivalTime" within a database as TIMESTAMP. </p>
  
  <p>EDIT: </p>
  
  <pre><code>&lt;?php
  $con = mysql_connect("localhost","root","") or die('Could not connect: ' . mysql_error());
  mysql_select_db("a&amp;e", $con) or die('Could not select database.');
  </code></pre>
  
  <p>// validate</p>
  
  <pre><code>$time = time(); $date = date('Y-m-d H:i:s',$time);
  
  $sql="INSERT INTO Patient(Forename, Surname, Gender, Date_Of_Birth, Address,    Patient_History, Illness, Priority, Arrival_Time)
  VALUES('$patient_name', '$patient_lastname', '$gender', '$date', '$address', '$history', '$illness', '$priority', '$time')";
  mysql_query($sql,$con) or die('Error: ' . mysql_error());
  
  echo "1 record added";
  // close connection 
  mysql_close($con);
  ?&gt;
  </code></pre>
  
  <p>Many thanks </p>