Jump to content

Display records from a DB at different time intervals


vickkeshav

Recommended Posts

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.. 

<?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.

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)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.