title: Get previous value after update - MySql
body: <p>I have a table which includes id and name</p>
  
  <pre><code>---    -----  
  id     name
  ---    -----
  1      pete
  </code></pre>
  
  <p>My scenarios looks like this</p>
  
  <pre><code>$sql = "SELECT name FROM table_name WHERE id=1";
  
  previous name - ''
  current name - pete
  </code></pre>
  
  <p>Now i'l update</p>
  
  <pre><code>$sql = "UPDATE table_name SET name='dave' WHERE id=1";
  
  previous name - pete
  updated name - dave
  
  $sql = "UPDATE table_name SET name='Alan' WHERE id=1";
  
  previous name - dave
  updated name - Alan
  </code></pre>
  
  <p>So after i update this table, i wanted to fetch previous record which was present in it. In my example i should get previous name as well as updated name. How to achieve this</p>