vickkeshav Posted January 26, 2012 Share Posted January 26, 2012 have a web base page where I want to generate records from my database one by one and at different time intervals. For example I have a table, Comment coment_id: 1 2 3 comment_message: "Hello", "Hi", "Bye" on the page, the first comment is Hello is posted then after 10 secs Hi is automatically posted then after 5 secs Bye is automatically posted. Quote Link to comment https://forums.phpfreaks.com/topic/255846-php/ Share on other sites More sharing options...
devWhiz Posted January 26, 2012 Share Posted January 26, 2012 I don't understand what you're trying to achieve, can you explain a little further? Quote Link to comment https://forums.phpfreaks.com/topic/255846-php/#findComment-1311500 Share on other sites More sharing options...
vickkeshav Posted January 26, 2012 Author Share Posted January 26, 2012 I have one table say its name is: User in this table there are 2 fields User_id and User_name User_id has 3 records so do user_name as shown below user_id | user_name 1 Tom 2 harry 3 ringo Next thing is that I have a webpage and i need to retrieve these names automatically each and 10 seconds interval That is if Tom appears on the page a 12.00 Harry appears at 12.10 and Ringo appears at 12.20 Quote Link to comment https://forums.phpfreaks.com/topic/255846-php/#findComment-1311505 Share on other sites More sharing options...
devWhiz Posted January 26, 2012 Share Posted January 26, 2012 $myQuery = "SELECT * FROM user"; $runQuery = mysql_query($myQuery); while($myArray = mysql_fetch_assoc($runQuery)){ echo $myArray['user_id']." ".$myArray['user_name']."<br />"; sleep(10); } Quote Link to comment https://forums.phpfreaks.com/topic/255846-php/#findComment-1311514 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.