random banner

  • 18 years ago

    i have a table called bannerads
    which fields are
    id,bannerpic,site_address
    I want to display these as a random banner
    at the moment there are 5 rows in this table.
    How would i do that

  • 18 years ago

    I have posted a new code on this site named Storing / Retrieving pictures from database I think It will help you. or try this link


    See this


  • 18 years ago

    SELECT * FROM bannerads ORDER BY RAND() LIMIT 1


    that should do what you want it to

  • 18 years ago

    So just call the DB and where youd put the Select add this to it. What if I have 1+ Banners

  • 18 years ago

    then change the limit to what ever number you want to be displayed.

  • 18 years ago

    Thanks heaps

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perl - The only language that looks the same before and after RSA encryption.” - Keith Bostic