Re: Get the INSERT statement from one row in Mysql
| From: | Camilo \"Zabyer\" Lozano III | Date: | Mon, 18 Nov 2013 19:55:28 +0000 |
| Subject: | Re: Get the INSERT statement from one row in Mysql | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-322472@lists.php.net to get a copy of this message | ||
I suggest create a function & stored procedure for that process...
On Tue, Nov 5, 2013 at 10:40 PM, Camilo Sperberg <unreal4u@gmail.com> wrote:
>
> On 05 Nov 2013, at 10:23, Anton Heuschen <antonfh@gmail.com> 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
>
>
--
=============================
MetaCatalyst Web Development Team
http://www.metacatalyst.com
http://www.metacatalyst.org
Zabyer Community
http://www.zabyer.org