2 Questions: PHP Timers & Question

  • timlab
  • Born
  • Born
  • timlab
  • Posts: 3
  • Loc: Walden, NY

Post 3+ Months Ago

1st Problem: Here's the problem. I have two rows of information in an sql. Now I would like the program to read the first row, output it, and then read the next one. However, I would like for the information that is being displayed to stay on the screen for at least 20 seconds. Therefore, I need a timer of some sort. Can anyone help me.?

2nd Problem: Once the sql has read all the rows from the top, how many times can you have the sql read?

Thanks![/u]
  • Cae
  • Expert
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

firstly, this should probably be in the programming forum...

1st problem:
php is server-side, you cannot have it do anything on the client computer, youd have to use JavaScript fo that... something like this:
Code: [ Select ]
setTimeout("window.location.href = targetURL", 200000);

that will redirect the page to the page 'targetURL' after 20 seconds...

second problem:
the 'mysql_fetch_row' is self-progressive (thats pro'lly not the right term, but thats what it does) every time you use it on you sql result, it progresses to the next row returned.

PHP Code: [ Select ]
 
$sql = mysql_db_query($database, $sqlQuery);
 
 
 
$row1 = mysql_fetch_row($sql); //returns first row
 
$row2 = mysql_fetch_row($sql); //returns second row
 
$row3 = mysql_fetch_row($sql); //returns third row
 
...
 
 
  1.  
  2. $sql = mysql_db_query($database, $sqlQuery);
  3.  
  4.  
  5.  
  6. $row1 = mysql_fetch_row($sql); //returns first row
  7.  
  8. $row2 = mysql_fetch_row($sql); //returns second row
  9.  
  10. $row3 = mysql_fetch_row($sql); //returns third row
  11.  
  12. ...
  13.  
  14.  

like that...
  • Rat
  • Guru
  • Guru
  • User avatar
  • Posts: 1190
  • Loc: desk

Post 3+ Months Ago

//Shouldn't this thread be moved?
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

//moved

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 51 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.