help query is so slow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

What seems to be the problem why my query to mysql is so slow.

I'm using it for accounting, wherein I need to get the start time they login 
and the time they logout then compute it.

to get the start time I did select * from table where blah blah and blah blah 
and blah;

to retrieve the data I used while ($row = mysql_fetch_assoc($start_time)) {

within that whle loop I then again did another query select * from table blah 
and blah and blah to get the end time.I did it inside the while loop because 
i need some data(3 columns) from my first query that acts as the primary key.

I think that querying again to get the end time while I'm still inside the 
while loop is the cause why it's to slow to display on the php page.

I'd like to get it out from the while loop but I can't ecause I need data 
from the first query, hope someone would understand this question. Thank  You


-- --
iTouch Communications, Inc.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux