Re: [PHP] Re: [PHP-DB] Re: MySQL Identifying worst-performing codes

2007-11-09 Thread Mark Summers
There may be something useful here... http://forge.mysql.com/ chris smith wrote: On Nov 9, 2007 1:18 AM, Colin Guthrie [EMAIL PROTECTED] wrote: Lasitha Alawatta wrote: There is a tool call idera (SQL diagnostic manager). Basically it is a performance monitoring and diagnostics

Re: [PHP] Regular Expressions

2007-11-07 Thread Mark Summers
There was no escaping in the original either. Also, I did assume that the list of replacements would grow to become pretty large. I wouldn't suggest doing this for a small list such as that given in the example. Robert Cummings wrote: On Wed, 2007-11-07 at 14:33 +, Mark Summers wrote

Re: [PHP] Regular Expressions

2007-11-07 Thread Mark Summers
This is a much better solution. I didn't realise that str_replace() accepted arrays as arguments for the search and replace terms. Mental note: reading mailing lists backwards doesn't work. Robert Cummings wrote: On Tue, 2007-11-06 at 23:24 -0300, Martin Alterisio wrote: 2007/11/6,

[PHP] Annoying PHP - MySQL communication timeout

2007-11-07 Thread Mark Summers
Has anyone here experienced a problem where a MySQL server seemingly closes a connection opened by PHP whilst the PHP script is still running? The problem only seems to affect scripts that run for a long time but there are a few things that make it unusual: 1) There is no obvious correlation

Re: [PHP] Regular Expressions

2007-11-07 Thread Mark Summers
This is a first attempt but the general idea is that the regular expression matching is done in one operation and then str_replace() is called only as many times as required instead of once for every line in your list. Also, str_replace() is faster than ereg_replace(). ?php $replace = array(

Re: [PHP] Why do I always come up with the hard stuff?

2007-08-07 Thread Mark Summers
Hello, I suspect that you need to assign the new instance of mysqli to $mysqli by reference to prevent the on-demand instance that is created by new from being copied (cloned) at the point of assignment. Mark Jason Pruim wrote: Yes I am hijacking a thread just to screw with all the people who

[PHP] Loss of precision in intval()

2007-08-01 Thread Mark Summers
This sort of thing really isn't helpful... ?php $a = 75.82 * 100; echo intval($a); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Loss of precision in intval()

2007-08-01 Thread Mark Summers
I like to think that I'm reasonably aware of the limitations of floating point (famous last words). To my mind, the ridiculousness (probably not a word) of the example is highlighted by the fact that 75.81 and 75.83 work perfectly. Roberto Mansfield wrote: Internally, 75.82 can't be stored