Gem Posted March 12, 2009 Share Posted March 12, 2009 Hiya .. Hopefully just a quick question .. my new homepage ... www.bradleystokejudoclub.co.uk/newindex.php is loading incredibly slow, and I figure it is because of the query that is in the Latest News section ... Is there a way to load the rest of the page and not have to wait for the query ... maybe some kind of "loading" in the latest news bit whilst its getting there?? Hope that makes sense... thanks Quote Link to comment https://forums.phpfreaks.com/topic/149186-query-making-my-page-slow-help/ Share on other sites More sharing options...
The Little Guy Posted March 12, 2009 Share Posted March 12, 2009 place that query in an iframe.... Or Optimize the query. Quote Link to comment https://forums.phpfreaks.com/topic/149186-query-making-my-page-slow-help/#findComment-783405 Share on other sites More sharing options...
Gem Posted March 12, 2009 Author Share Posted March 12, 2009 I know know how to do either of those things ... :-\ Quote Link to comment https://forums.phpfreaks.com/topic/149186-query-making-my-page-slow-help/#findComment-783407 Share on other sites More sharing options...
The Little Guy Posted March 12, 2009 Share Posted March 12, 2009 wanna show your query? Quote Link to comment https://forums.phpfreaks.com/topic/149186-query-making-my-page-slow-help/#findComment-783410 Share on other sites More sharing options...
Gem Posted March 12, 2009 Author Share Posted March 12, 2009 Sure ... <?php $con = mysql_connect(" =) "); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("bssql", $con); $result = mysql_query("SELECT `title`, `subtitle` FROM `articles` ORDER BY `ID` DESC LIMIT 5") or die(mysql_error()); while($row = mysql_fetch_assoc($result)) { ?><b><?php echo $row['title'];?></b> <BR><?php echo $row['subtitle']?><BR><?php } mysql_close($con); ?> Quote Link to comment https://forums.phpfreaks.com/topic/149186-query-making-my-page-slow-help/#findComment-783412 Share on other sites More sharing options...
The Little Guy Posted March 12, 2009 Share Posted March 12, 2009 I don't think it is your query... Quote Link to comment https://forums.phpfreaks.com/topic/149186-query-making-my-page-slow-help/#findComment-783416 Share on other sites More sharing options...
Gem Posted March 12, 2009 Author Share Posted March 12, 2009 hmmm ... it must have something to do with that part of the page cuz I just took it off and it loaded fast, and when I put that bit back in, its all slow again ... How annoying ... Quote Link to comment https://forums.phpfreaks.com/topic/149186-query-making-my-page-slow-help/#findComment-783423 Share on other sites More sharing options...
Gem Posted March 13, 2009 Author Share Posted March 13, 2009 OK - Best thing I could do is add a script for load page ... Thanks anyway Quote Link to comment https://forums.phpfreaks.com/topic/149186-query-making-my-page-slow-help/#findComment-783444 Share on other sites More sharing options...
MadTechie Posted March 13, 2009 Share Posted March 13, 2009 gemmerz, if you want the page to display and don't mind the delay for the last part, may i suggest using flush() ie <?php echo "Start of the page..<br>"; flush(); sleep(2); //delays echo "Rest of the page"; ?> as for your mysql connection, i assume your using localhost! you say you figure it because of the sql.. but is this a guess or have you tried removing it to see if it speeds up ? Quote Link to comment https://forums.phpfreaks.com/topic/149186-query-making-my-page-slow-help/#findComment-783461 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.