title: Get the id of current mysql insert
body: <p>is there anyway to get the ID of the current record I am <strong>INSERTING</strong> into the database table using php with Mysql without having to do an extra select to get the last ID?</p>
  
  <p>FOr example, if my table has these columns, id, url, name 
  and if url consists of the domain name and current id as the query variable ex:
  domainname.com/page.php?id=current_id</p>
  
  <pre><code>$sql="INSERT INTO Persons (id, url, name )
  VALUES
  ('domainname.com/page.php?id=".**whats_the_current_id**."','$_POST[age]')";
  
  if (!mysql_query($sql,$con))
    {
    die('Error: ' . mysql_error());
    }
  </code></pre>