title: How to get ID of row which is getting affected when used "REPLACE INTO" in mysql
body: <p>I am using <code>REPLACE INTO</code> command for inserting/updating record in MySQL table. However I want to get ID of row which gets affected by <code>REPLACE INTO</code>.</p>
  
  <p>I used <code>lastInsertId()</code> with <code>INSERT INTO</code> but it is not useful over here because if my record already exists then by using <code>lastInsertId()</code> with <code>REPLACE INTO</code>, i'll get wrong ID.</p>
  
  <p>So is there any function present in MySQL + php + PDO to get that id?</p>