title: Converting string to MySQL timestamp format in php
body: <p>I am writing a query in php using a string sent from a android java application.
  <br> The query is something like :</p>
  
  <pre><code>$insertSQL = sprintf("INSERT INTO app_DuckTag (taste) VALUES (%s) WHERE species=%s AND timestamp=%s",
                           GetSQLValueString($_POST['taste'], "text"),
                           GetSQLValueString($_POST['species'], "text"),
                           GetSQLValueString($_POST['timestamp'], "text"));
  </code></pre>
  
  <p>But I doubt timestamp is stored as a string inside MySQL. 
  <br> How should I convert the string to time format as in MySQL? 
  <br> The strtotime(string) php function converts it to unix time. 
  <br>But the MySQL stores it differently, I guess. Thank you.</p>
  
  <p>EDIT: This is how it shows up in MySQL phpmyadmin: 2011-08-16 17:10:45</p>
  
  <p>EDIT: My query is wrong though. Cannon use a where clause with Insert into. <br>
  The query has to be UPDATE .... SET ... = ... WHERE .... <br>
  But the accepted answer is the correct way to use the time inside the WHERE clause.</p>