title: Return a value from an INSERT query in mysql?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1685860/php-how-to-get-last-inserted-id-of-a-table">PHP: how to get last inserted ID of a table?</a>  </p>
  </blockquote>
  
  
  
  <p>This is my query for inserting a new post into the posts table (PHP/mysql). Can I return the post_id for the post just inserted in the same statement? I need the post_id for insertion into another table.</p>
  
  <pre><code>mysql_query("INSERT INTO `posts` (`post_id`, `date`, `title`, `content`) VALUES (NULL,    NOW(), '$title', '$fileName')");
  </code></pre>