title: MySQL trigger changes in a table
body: <h3>I want to log any UPDATE on any table using mysql, but within the log I want to record the 'old' value and the 'new' one.</h3>
  <p>For instance I have this table:</p>
  <h3>user:</h3>
  <pre><code>+-------------------+
  | id                |
  | email             |
  | password          |
  | birthdate         |
  +-------------------+
  </code></pre>
  <p>values:</p>
  <p>1:'test@test.com':'123456':'1995-07-23'</p>
  <hr />
  <p>And I decide to change the birthday for id=1 to '1996-07-23'</p>
  <p>So, I would like to log into 'history' table the following:</p>
  <p><strong>table_name: 'user', field_name: 'birthdate', previous_value: '1995-07-23', new_value: '1996-07-23'</strong></p>
  <h3>history table:</h3>
  <pre><code>+-------------------+
  | id                |
  | table_name        |
  | field_name        |
  | previous_value    |
  | new_value         |
  | history_datetime  |
  +-------------------+
  </code></pre>
  <p>Any advise to achieve that ?</p>