[FX.php List] Sluggish load time for query... part two...
Bob Patin
bob at patin.com
Tue Mar 21 08:02:30 MST 2006
OK, here's the results of my testing:
When I leave a single query in the page, it goes through in less than
a second.
However, when I made a test page containing one of the other queries,
it took 20 seconds each time. Below is my code:
include_once('FX/FX.php');
include_once('FX/server_data.php');
$search3=new FX($serverIP,$webCompanionPort);
$search3->SetDBData('afm_articles.fp7','1','1');
$search3->SetDBPassword('141511th','Bob Patin');
$search3->AddDBparam('is_preview2','Yes');
$search3Result=$search3->FMFind();
foreach($search3Result['data'] as $key=>$search3Data)
$recordDetails=explode('.',$key);
$previewID2=$recordDetails[0];
$date3 = $search3Data['date'][0];
$title3 = $search3Data['title'][0];
$preview3 = $search3Data['preview'][0];
//$preview3= str_replace("\n","<br>",$preview3);
$image_url3 = $search3Data['image_url'][0];
$image_caption3 = $search3Data['image_caption'][0];
$author3 = $search3Data['author'][0];
I have 2 queries doing almost the same thing; the only additional
code are 4 ECHO commands that show my variables on the page.
Here's the odd thing: my first query returns a dozen marked records;
it takes less than a second.
This query, above, takes 20 seconds, and returns a single record; you
can see how few fields I'm returning.
Any thoughts? I even commented out the str_replace command, but when
I add it back the difference is negligible.
I tried commenting out all of the variable assignments, so that all
that happens is the query itself, but that makes no difference either.
I can't see anything that is causing this; I also can't think of a
way to do all of this in a single query. If anyone has any
suggestions, that would be great. If you go to
http://www.afm257.org/index3.php, you'll see the results of the 3
queries on the page. If you go to the site without specifying a page,
you'll see "index.php," which has only a single query in it, and
which loads really fast.
Stumped,
Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
CONTACT US VIA SKYPE:
USERNAME: longtermsolutions
CONTACT US VIA INSTANT MESSAGING:
AIM or iChat: longterm1954
Yahoo: longterm_solutions
MSN: bob at patin.com
ICQ: 159333060
More information about the FX.php_List
mailing list