Loans - Debt Consolidation - Deaf Topics - Online Advertising - Find jobs

PDA

View Full Version : pulling results from db using php, rotating using javascript


AussieFreelancer
Dec 5th 2006, 7:36 pm
Hi everyone,

I am a PHP programmer, and I am currently developing a website whereby the client has asked that the results are rotated.

Each day, results of games are stored in the MySQL database, and there will be a varying number of games for the day. One day there might be 2, another there might be 10.

I would like to provide a solution where the website will display a specified number of results, and then 5 seconds later, automatically display the next lot, and so on. This should be on a continuous loop, so that when the last result is reached, the process repeats.

I don't know much about javascript, so was wondering if someone could help me build this? So far, I have the following:

<script>

var limit = 4;

var from = 0;
var to = from + limit;

function rotate_scores(s)
{
window.setTimeout('change_scores()', s*1000)
}

function change_scores()
{

}

</script>
but i don't know where to go from here. not sure on the syntax of how to get the results from the db, into something that javascript can use.

any help would be really appreciated

Many thanks

Patrick

krakjoe
Dec 6th 2006, 3:39 am
The explanation is rather large, I'll be happy to help you on msn ....

mad4
Dec 6th 2006, 3:43 am
Do you want something like this?
http://forums.digitalpoint.com/spy.php

krakjoe
Dec 6th 2006, 3:45 am
That is cool, I never seen that before ....