vickkeshav Posted February 12, 2012 Share Posted February 12, 2012 Hello Everyone, I wanted to know how to Display records from a Table one by one at difference time intervals. Kindly suggest Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/ Share on other sites More sharing options...
litebearer Posted February 12, 2012 Share Posted February 12, 2012 Oops! deleted Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/#findComment-1317225 Share on other sites More sharing options...
litebearer Posted February 12, 2012 Share Posted February 12, 2012 How many different images will you be using? Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/#findComment-1317227 Share on other sites More sharing options...
vickkeshav Posted February 12, 2012 Author Share Posted February 12, 2012 They are texts not images. ok so I have am calling the records 1 by 1, using mysql_fetch_assoc ( .... ) and so on, All the records are displayed at once, but what I want is to display them at different intervals. Please help if u can, i,ve been struggling with this for days.. Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/#findComment-1317229 Share on other sites More sharing options...
litebearer Posted February 12, 2012 Share Posted February 12, 2012 Show us the code you have tried thus far AND explain how the time intervals are to be determined Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/#findComment-1317233 Share on other sites More sharing options...
vickkeshav Posted February 12, 2012 Author Share Posted February 12, 2012 <?php include ("db_connect.php"); $q=$_GET['q']; $nxtreply= $q+1; $all= "select * from cmt"; $result= mysql_query($all); $numrows = mysql_num_rows($result); $i=1; while($i<$numrows){ $sql="SELECT cmmt FROM cmt WHERE cat_num = '$nxtreply' ORDER BY RAND()LIMIT 0,1"; $result2 = mysql_query($sql); while($row = mysql_fetch_assoc($result2))  { echo "<button type='button' onclick= com() >SIMULATE</button> "; echo "<table border='1'> <tr> <th>Comment</th> </tr>";  echo "<tr>";  echo "<td>" . $row['cmmt'] . "</td>";  echo "</tr>";  } echo "</table>"; $nxtreply++; $i++; } mysql_close($con); ?>    These are the codes, the records from the table are displayed all at the same time, I want each Record to be displayed at different time intervals  MOD EDIT: . . . BBCode tags added. Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/#findComment-1317234 Share on other sites More sharing options...
Pikachu2000 Posted February 12, 2012 Share Posted February 12, 2012 When posting code, enclose it within the forum's . . . BBCode tags. Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/#findComment-1317235 Share on other sites More sharing options...
litebearer Posted February 12, 2012 Share Posted February 12, 2012 Showing 1 set of data is easy. We still need to know what are the intervals and how do those relate to each set of data. Â Are the intervals units of time? Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/#findComment-1317236 Share on other sites More sharing options...
scootstah Posted February 12, 2012 Share Posted February 12, 2012 If you want to delay it by say a few seconds, your best bet is to load the results into Javascript and delay it that way. PHP can't output in intervals... it is all or nothing. Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/#findComment-1317237 Share on other sites More sharing options...
litebearer Posted February 12, 2012 Share Posted February 12, 2012 Good catch, scoots, I wasn't even thinking in that direction this morning Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/#findComment-1317238 Share on other sites More sharing options...
vickkeshav Posted February 12, 2012 Author Share Posted February 12, 2012 the intervals are in seconds, suppose I have a range of int; 1 to 10 So the first post is echoed without any interval, the second record must be echoed after say 5 seconds (any number from range 1 to 10) and the third record maybe after 6 second or 8 seconds.. (it can be any seconds as far as it there is a delay between the last echoed record and the present echoed record) Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/#findComment-1317239 Share on other sites More sharing options...
vickkeshav Posted February 12, 2012 Author Share Posted February 12, 2012 Hey I tried loading them in Js as well but read from some post on the internet that php is server side and js is client side etc etc, I tried using setTimeout ()... Please tell me how to proceed Quote Link to comment https://forums.phpfreaks.com/topic/256936-display-records-from-a-db-at-different-time-intervals/#findComment-1317240 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.