Re: Getting queries from files FYI
| From: | Raj Shekhar | Date: | Mon, 29 Aug 2005 04:11:57 +0000 |
| Subject: | Re: Getting queries from files FYI | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-221491@lists.php.net to get a copy of this message | ||
Robin Vickery <robinv@gmail.com> writes:
> On 8/23/05, Jay Blanchard <jay.blanchard@niicommunications.com> wrote:
> > You may (or may not) remember me posting to the list a couple of weeks
> > ago asking about using REGEX to get queries out of PHP files for a
> > migration project. I had to let it go for several days, but started
> > working on it again yesterday, here is the code (no REGEX was used in
> > the making of this code);
>
> Just a thought - and I know it's a little late, sorry.
>
> Have you considered writing a wrapper for mysql_query() that logs its
> parameters?
(I cannot locate the original post, hence replying to this mail)
You can enable logging in mysql server itself to log all queries
http://dev.mysql.com/doc/mysql/en/binary-log.html
( there are ways to
restrict logging to only some databases) . Later when you want to replay
the sql statements, you can use mysqlbinlog
--
Raj Shekhar
blog : http://rajshekhar.net/blog home : http://rajshekhar.net
Disclaimer : http://rajshekhar.net/disclaimer