title: How to obtain with PHP the last ID inserted if my primary key does not autoincrement
body: <p>I have a table in MySQL that for compatibility issues we assigned specific Primary Keys, therefore they can not be auto incremented.</p>
  
  <p>Every time we insert a new topple (in PHP) we need to get back the latest ID inserted. It might sound stupid. but we do not generate the ID from PHP, it comes from an generic AJAX function, therefore we don't know the name of the variable containing the Primary Key, it always changes.</p>
  
  <p>Is there a way, using PHP or MYSQL, to obtain the latest ID inserted for a primary key that does not auto-increment?</p>
  
  <p>Unfortunately mysql_insert_id() and last_insert_id() do not work without auto_increment.</p>
  
  <p>Thanks!</p>