title: How to get back the last inserted row mysql
body: <p>Alright I have been looking for this for a while now, and didn't really found an answer to my problem.</p>
  
  <p>At the moment I got this syntax:</p>
  
  <pre><code>$sql = sprintf("INSERT INTO users (***, ***, ***, ***) VALUES ('%s', '%s', '%s', %d)", mysql_real_escape_string($***), mysql_real_escape_string($***), mysql_real_escape_string($***), $***);
  if(!mysql_query($sql)) { die('error: '.mysql_error()); }
  return mysql_insert_id();
  </code></pre>
  
  <p>And this works fine, and when I want to get an item back from the last inserted row I could do another query with the id I get back.</p>
  
  <p>But my question is, is it possible to give back the whole row at once? So that I don't have to run another query to get an item from the last inserted row.</p>