RE: [PHP] how to get time cost for MySQL query

2005-07-12 Thread yanghshiqi
"query time" by mysql in php script is useless as there are many other factors can affect you. Best regards, Shiqi Yang -Original Message- From: Ahmed Saad [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 12, 2005 11:43 PM To: php-general@lists.php.net Subject: [PHP] how t

[PHP] how to get time cost for MySQL query

2005-07-12 Thread Ahmed Saad
On 7/11/05, x <[EMAIL PROTECTED]> wrote: > Since we can see the time cost each time we query MySQL through MySQL > console (such as 75 rows in set (0.01 sec)), so I am wondering there is > already an existing function which will return the value... I think you are confusing two things: mysql serve

Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread Richard Lynch
Try doing an "explain $query" query. I *think* MySQL might cache the query/results enough that you'd get an accurate estimate... You could also turn MySQL Logging on. Or, rather crudely, time it in PHP: $query_start_time = microtime(); $result = mysql_query($query); $query_end_time = microtime(

Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread x
I did checked both of them and it seems they do not provide such info... thanks "Philip Hallstrom" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Hi, Is there any MySQL lib function which can provide time cost for last >> query? >> > > Maybe... > > http://us2.php.net/manual/en/funct

Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread x
I did checked both of them and it seems they do not provide such info... thanks "Philip Hallstrom" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Hi, Is there any MySQL lib function which can provide time cost for last >> query? >> > > Maybe... > > http://us2.php.net/manual/en/fun

Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread Philip Hallstrom
Hi, Is there any MySQL lib function which can provide time cost for last query? Maybe... http://us2.php.net/manual/en/function.mysql-info.php http://us2.php.net/manual/en/function.mysql-stat.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.

[PHP] how to get time cost for MySQL query

2005-07-11 Thread x
Hi, Is there any MySQL lib function which can provide time cost for last query? Since we can see the time cost each time we query MySQL through MySQL console (such as 75 rows in set (0.01 sec)), so I am wondering there is already an existing function which will return the value... Thanks -- PHP