Re: Get the INSERT statement from one row in Mysql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05 Nov 2013, at 10:23, Anton Heuschen <antonfh@xxxxxxxxx> wrote:

> Good day,
> 
> I am trying to find a way, how I can look for one row in a table with a
> search for the id, but then I use this to give me the INSERT statement
> (which creates this row again)
> 
> What I am trying to do, is get an audit where any update - checks the state
> of a row, saves it as its INSERT statement and saves this to an audit file
> .
> 
> 
> Regards
> 
> Anton

This is more a MySQL related question than a PHP one... 

>From what I know, there is no way to make MySQL generate an insert statement from an existing row. The only way that I know about would be invoking mysqldump.

If you want an audit log, I suggest you better take a look at the binary logs from MySQL, combining automatic backups+binary log you can easily re-assemble the structure of a table/database. Plus, the binary log has everything you want: it logs dates and times, the exact executed queries and you can easily take snapshots from that.

Greetings.
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux