mattVo Posted June 1, 2009 Share Posted June 1, 2009 Hi all, I'm having a problem that shows up once in a while, where content of my dynamically driven pages doesnt display when I first load up the page. I have to hit refresh and then it'll display. And it's content that is stored on a database. I suspect the problem is that the page is being displayed before the data from the database has been sent completely. Is there a solution to this? I've tried output buffering but the problem persists. Thanks all, Matt Quote Link to comment https://forums.phpfreaks.com/topic/160545-empty-pages/ Share on other sites More sharing options...
Ken2k7 Posted June 2, 2009 Share Posted June 2, 2009 I have no idea. You may want to post up some code. Are you using mysql_pconnect? If so, don't. That's my only suggestion for now. :-\ Quote Link to comment https://forums.phpfreaks.com/topic/160545-empty-pages/#findComment-847402 Share on other sites More sharing options...
gizmola Posted June 2, 2009 Share Posted June 2, 2009 There could be any one of a hundred problems. Are there any errors in the error log when this occurs? Do you have access to the server via ssh so that you can see what's happening in the OS? Quote Link to comment https://forums.phpfreaks.com/topic/160545-empty-pages/#findComment-847404 Share on other sites More sharing options...
mattVo Posted June 2, 2009 Author Share Posted June 2, 2009 THanks for the replies! I'm not using mysql_pconnect, so that's not the problem here. Where do I access the error log? I'm pretty new to this so bare with me... Also, I'm not the admin of the server and have limited access to thins. But I can ask the sysop and see what's going on. So here is what's not displaying... A sidebar menu. Seems pretty straight forward to me... The rest of the page displays fine. Can it be that the server where our database resides has a huge latency? <?php ////////////////////////////////////// // VARIABLES ////////////////////////////////////// $upcomingArtist = ''; ////////////////////////////////////// ////////////////////////////////////// // QUERYs ////////////////////////////////////// $sqlUpcomingArtist = 'SELECT id_artiste, nom FROM artiste WHERE active_ca = 1 ORDER BY nom'; $queryUpcomingArtist = mysql_query($sqlUpcomingArtist); ////////////////////////////////////// $upcomingArtist .= '<ul style="list-style: none;">'; while ($rowUpcomingArtist = mysql_fetch_array($queryUpcomingArtist)) { $upcomingArtist .= ' <li><a href="/artist/'. retireAccents($rowUpcomingArtist['nom']) .'/overview" class="menu">'. $rowUpcomingArtist['nom'] .'</a></li>'; } $upcomingArtist .= '</ul>'; echo $upcomingArtist; ?> Quote Link to comment https://forums.phpfreaks.com/topic/160545-empty-pages/#findComment-847790 Share on other sites More sharing options...
gizmola Posted June 2, 2009 Share Posted June 2, 2009 You want to see the error log which is typically the apache error log. Usually it's in /var/log/httpd/. Assuming this is a vhost the log name gets configured by the person who sets up the server. On the mysql side you want to have the slow query log turned on, and see if there are issues there. In regards to network latency, anything is possible but you'd have to rule out a lot of other issues, and I'd expect you'd see some sort of error in the error logs. Quote Link to comment https://forums.phpfreaks.com/topic/160545-empty-pages/#findComment-847972 Share on other sites More sharing options...
mattVo Posted June 3, 2009 Author Share Posted June 3, 2009 I'll try to find the error logs and look at those. In the meantime, is there a way to check if data has been sent from the database before displaying the page? When data is there, then display the page? THanks! Quote Link to comment https://forums.phpfreaks.com/topic/160545-empty-pages/#findComment-848568 Share on other sites More sharing options...
gizmola Posted June 4, 2009 Share Posted June 4, 2009 I don't understand your question. The pages gets buffered and if there are queries, it already won't display until it has data, however there are limits and if things timeout, you may get things that are broken. It seems like you're looking for a way around trying to actually figure out what your issue is. There's nothing simpler and more effective initially than the two suggestions I gave you. *Not* looking into those is like putting your head in the sand. Quote Link to comment https://forums.phpfreaks.com/topic/160545-empty-pages/#findComment-849450 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.