title: how to maintain records current as well as previous in mysql
body: <p>Hi any one please help i have a contact table in which i can Insert,Delete,Modify database using PHP web pages....but only current changes will be updated to database. what i want is how i can maintain history of database...
    Is there any tutorial for this using (PHP/MYSQL).
  I tried creating version of MySQL table for patient... how to proceed further.</p>
  
  <pre><code> CREATE TABLE IF NOT EXISTS `contact` (
    `name` varchar(30) NOT NULL,
    `phone` varchar(12) NOT NULL,
    `mobile` varchar(12) NOT NULL,
    `email` varchar(30) NOT NULL,
    `address` text NOT NULL,
    `conid` int(11) NOT NULL AUTO_INCREMENT,
    PRIMARY KEY (`conid`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; # MySQL returned an empty result set (i.e. zero rows).
  
     CREATE TABLE IF NOT EXISTS `contactversion` (
     `name` varchar(30) NOT NULL,
     `phone` varchar(12) NOT NULL,
     `mobile` varchar(12) NOT NULL,
     `email` varchar(30) NOT NULL,
     `address` text NOT NULL,
     `conid` int(11) NOT NULL,
     `revision_id` int(11) AUTO_INCREMENT,
      type ENUM('INSERT', 'UPDATE', 'DELETE') NOT NULL,
     `change_time` DEFAULT current_timestamp,
      PRIMARY KEY (`revision_id`)
   );
  </code></pre>
  
  <p>what to do next....</p>