Cycle fixed image with random image?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
melost
Forum Newbie
Posts: 1
Joined: Mon Dec 15, 2008 9:59 pm

Cycle fixed image with random image?

Post by melost »

Hi All,

I am not entirely familiar with php and am trying to display an image on my site from a recordset which will reload every several seconds with a fixed(set) image. Example: Random image from rs (time delay) set image (time delay) Random image from rs etc..

Currently I have the following code that is working well for displaying a random image however I want to change 2 things with it 1) as it is it only alternates on page refresh, so how would i make it alternate every several seconds? 2) How would I make it reload to a set image and alternate with an image from the database?

Code: Select all

SELECT ImageFile rand() as random_number
FROM clublistingpics
ORDER BY random_number DESC LIMIT 1
Thanks to anyone that can offer advise with this.
maneetpuri
Forum Commoner
Posts: 60
Joined: Tue Oct 07, 2008 6:32 am

Re: Cycle fixed image with random image?

Post by maneetpuri »

Hi,

AJAX is the answer or you can even do it using XML & Flash.

Cheers,
Post Reply