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. Quote Link to comment 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 Quote Link to comment 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! Quote Link to comment 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 Quote Link to comment 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! Quote Link to comment 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.