Jump to content

Query takes long time


sandy1028

Recommended Posts

Please help me

 

$result = mysql_query("select jobid,unix_timestamp(subtime)) from `completedtable`");
                $no_of_rows = mysql_num_rows($result);
        while($r = mysql_fetch_array($result)){
                $exec = '';
                $res = mysql_query("select distinct(exec) from `exectable` where jobid='".$r[0]."'");
                //$res=mysql_query($res1);
                while($row = mysql_fetch_array($res)){
                   $exec .= $row[0]."\n";
                }

 

The field exec has more than 3 rows so I have used it in while loop. Which takes lots of time to query.

How can I make a query faster.

Two tables has jobid has common field name.

 

Link to comment
https://forums.phpfreaks.com/topic/102455-query-takes-long-time/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.