Re: Next page every second

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If all you want to display each record one by one at a particular interval
of time
you could do this at one page itself...here is the procedure....

1. connect to mysql
2. grab the row you want
3. store the row number in a session variable
4. Add an autorefresh code to ur html..(lot of java scritps are there for
setting the time interval for the page refresh)
5.  when the page again loads grab the row number from session and increment
it by one

hope that the logic will work out...

/sagar
----- Original Message -----
From: "Greg Wardawy" <wardawyg@xxxxxxxxxxxxx>
To: <php-general@xxxxxxxxxxxxx>
Sent: Friday, December 24, 2004 10:39 AM
Subject:  Next page every second


> Ladies and gentlemen of PHP,
>
> I'm quite new to PHP (coming from Perl) so please don't laugh too hard if
> I'm missing something obvious.
> My scenario is as follows:
> Connect to the MySQL server->grab the data from the table->display the
data
> of the first row on the web page->sleep 1 second->display the data from
the
> next row->sleep 1 second... and so forth up to the last row of the table.
> I'm able to get the next page displayed by using a link to it (a snippet
> below) but I'm out of ideas how to have the next page displayed every
> second. So far I'm getting tons of tables displayed on the page or tons of
> the variables displayed in a single cell of the table. I could really use
> your help here.
> Happy Holidays to all of you and many thanks for any suggestions given.
>
> Greg.
>
############################################################################
#############
> __SNIP__
> <table width="420" height="12" border="3" cellpadding="6" cellspacing="4"
> bordercolor="#9900CC">
>   <tr>
>     <th width="60" scope="col">Variable</th>
>     <th width="360" scope="col">Value</th>
>   </tr>
>   <?php do { ?>
>   <tr>
>     <th width="60">1</th>
>     <td width="360" nowrap="nowrap" bordercolor="#660066"
> bgcolor="#FFFFFF"><div align="right" class="style8">        <?php echo
> $row_gail_data['var1']; ?>    </div></td>
>   <tr>
>     <th width="60">2</th>
>     <td width="360" nowrap="nowrap" bordercolor="#660066"
> bgcolor="#FFFFFF"><div align="right" class="style9">        <?php echo
> $row_gail_data['var2']; ?>    </div></td>
>   </tr>
>   <tr>
>     <th width="60">3</th>
>     <td width="360" nowrap="nowrap" bordercolor="#660066"
> bgcolor="#FFFFFF"><div align="right" class="style10">        <?php echo
> $row_gail_data['var3']; ?>    </div></td>
>   </tr>
>   <tr>
>     <th width="60">4</th>
>     <td width="360" nowrap="nowrap" bordercolor="#660066"
> bgcolor="#FFFFFF"><div align="right" class="style7">        <?php echo
> $row_gail_data['var4']; ?>    </div></td>
>   </tr>
>   <?php } while ($row_gail_data = mysql_fetch_assoc($gail_data)); ?>
> </table>
> </p>
> <p><a href="<?php printf("%s?pageNum_gail_data=%d%s", $currentPage,
> min($totalPages_gail_data, $pageNum_gail_data + 1),
$queryString_gail_data);
> ?>">Next</a>
> </p>
> __SNIP__
>
############################################################################
#############
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux