Forum Moderators: coopster

Message Too Old, No Replies

Rotate info compiled from mysql

         

derek mcgilvray

4:45 pm on Jun 1, 2007 (gmt 0)

10+ Year Member



Hi folks,
Just after a short answer here before I spend even more time trying to work it out by myself.
I can collect up to date info from mysql tables and display them without any troubles on my page. However, it takes up a lot of space, so I would instead like to rotate the information, say 10 seconds for each section.
Now, I'm able to use a javascript/scrolling script that I found to do this job for plain text and it parses php as well, but I can't seem to get it working when I'm querying the database.
Is it possible and, if so, could someone please point me in the right direction?

Thanks in advance,

Derek

Duskrider

5:57 pm on Jun 1, 2007 (gmt 0)

10+ Year Member



This may be a bit complicated for what you want to do, but it seems to me like this could be done with a text file and an exterior php call, so long as you don't pull a great deal of information out of your database it shouldn't be a big deal.

This is something I'm coming up with off the top of my head, so I haven't tried it. Somewhere on the page with the information you want to display include an invisible iframe, referencing a php file which pulls information out of your database and throws it into a text file. Your javascript can then, every 10 seconds, both update the information it displays from that text file, and reload the php page within the iframe, thus refreshing the information in the text file for the next load.

In this way you'll only be updating that text file when someone is on the page, but they'll always get updated information. It may be a little sloppy, and could get ugly if you have a bunch of people all looking at the page (and all requesting an update every 10 seconds).

Hopefully it gives you a direction though. :)

derek mcgilvray

4:21 pm on Jun 4, 2007 (gmt 0)

10+ Year Member



Thanks Duskrider,

Iframes did the job perfectly.