I want to display random images and the corresponding text that will tell what the image is all about.

Right now I have the images rotating every 5 seconds which is taken from a database and I want to have the corresponding text which is also taken from the database to match with the image that is being displayed. Only one image and the corresponding text should be displayed at a time.

The rotation of the images work fine, I just need the text to match the image that is being display and when the images changes the text should also change.

for example:
images text


image1 bird
image2 dog

Can someone please help me?

Once again, I thank you all in advance for all your help.

Gil

    for randomization, take a look at srand() and rand().

    For matching text, I would store the text and the image in the same database. This way when you can pull both the name and image out from the same record.

    Goold luck

    http://www.bringitlive.com

      Gilbert is right, and mysql 3.23 and up will allow you to select random rows:
      select pic, text from table_name order by rand() limit 0,1

        Write a Reply...