pacome Posted April 29, 2007 Share Posted April 29, 2007 hi... I'm trying to program a small game for myself... I've got some data in a DB which I extract within a WHILE loop, but I would like the data extracted to print slowly, not all at once! let's evey 30 seconds interval... while ($cont < { extract data; print one of the 8 every 30 seconds; } ¿which function or line does this type of thing? thank you. Link to comment https://forums.phpfreaks.com/topic/49175-printing-db-data-separetly/ Share on other sites More sharing options...
Barand Posted April 29, 2007 Share Posted April 29, 2007 ¿which function or line does this type of thing? In PHP, none. PHP runs on the server and delivers the whole page when the script has executed. To do what you you want would require a javascript (client-side) timer event and either a javascript array generated by the PHP code or an AJAX solution to fetch 1 st record, then on next call, get first 2 records etc Link to comment https://forums.phpfreaks.com/topic/49175-printing-db-data-separetly/#findComment-240996 Share on other sites More sharing options...
pacome Posted April 29, 2007 Author Share Posted April 29, 2007 right... so I will check Javascript thanks again! Link to comment https://forums.phpfreaks.com/topic/49175-printing-db-data-separetly/#findComment-240999 Share on other sites More sharing options...
Barand Posted April 29, 2007 Share Posted April 29, 2007 PS Although an HTML meta refresh and a session variable as a counter might accomplish it Link to comment https://forums.phpfreaks.com/topic/49175-printing-db-data-separetly/#findComment-241001 Share on other sites More sharing options...
pacome Posted April 29, 2007 Author Share Posted April 29, 2007 ok! I will try with the meta... and see if I manage to do it! after all is only a game and I can allow myself to be flexible... thanks! Link to comment https://forums.phpfreaks.com/topic/49175-printing-db-data-separetly/#findComment-241019 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.