Re: logging changes to a mysql database
| From: | phobo | Date: | Fri, 02 Feb 2001 22:02:45 +0000 |
| Subject: | Re: logging changes to a mysql database | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-6332@lists.php.net to get a copy of this message | ||
When: very easy. Add a TIMESTAMP field to the table; this is automatically
updated everytime the contents of the row are altered.
Who: almost as easy. Add an IP column; When updating/inserting a row; set it
to $REMOTE_ADDR. You can use ip2long function to make the IP only 4 bytes so
that it doesn't use up lots of space.
http://www.php.net/manual/en/function.ip2long.php
)
With "who", you should really narrow down your IP permissions anyway; MySQL
has VERY powerful control over who can do what, its great (you can set that
some IPs can only select a columns of a table in a database etc, its almost
ludicrously pedantic!)
Siggy
----- Original Message -----
From: "kmurrah" <kmurrah@bakergrfx.com>
To: <php-db@lists.php.net>
Sent: Saturday, February 03, 2001 5:37 AM
Subject: [PHP-DB] logging changes to a mysql database
> Greetings.
>
> Is it possible to log who and when changes are made to a mysql database ?
> If not, is there another open source DB that you could recommend ?
>
> Thanks,
>
> KennM
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>