Re: Re: Getting queries from files FYI
| From: | Jasper Bryant-Greene | Date: | Mon, 29 Aug 2005 05:25:12 +0000 |
| Subject: | Re: Re: Getting queries from files FYI | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-221492@lists.php.net to get a copy of this message | ||
Raj Shekhar wrote:
Robin Vickery <robinv@gmail.com> writes:Yes, but as this is a migration project (as indicated by the OP), that would require you going through and running every possible branch of the application code to get MySQL to execute the queries and therefore log them. Logging queries that are run is a different thing than pulling all of the SQL queries out of given PHP files. -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/ If you find my advice useful, please consider donating to a poor student! You can choose whatever amount you think my advice was worth to you. http://tinyurl.com/7oa5sOn 8/23/05, Jay Blanchard <jay.blanchard@niicommunications.com> wrote:(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 mysqlbinlogYou 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?