SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I need help with PHP please

    Hi,

    I have been reading the book by Kevin Yank, Build your own database driven website. And I kinda get the whole database linking to html via php but the query I have is:

    I am trying to make a section on my site where people can advertise there companies. I would like the page to look like:

    ABC Limited
    Tel: XXX XXXX XXXX
    Email: xxxxxxxxxxxx
    Web: xxxxxxxxxxxxxx

    XYZ Limited
    Tel: XXX XXXX XXXX
    Email: xxxxxxxxxxxx
    Web: xxxxxxxxxxxxxx

    123 Limited
    Tel: XXX XXXX XXXX
    Email: xxxxxxxxxxxx
    Web: xxxxxxxxxxxxxx

    But to make it fair I would like them to appear in different orders each time the page is opened. For example, 123 Limited to sometimes appear at the top etc.

    Is there any way I can do this? If so the is anyone able to point me in the right direction?

    Many thanks,

    David

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just add to your query that's fetching the data:
    ORDER BY RAND()

  3. #3
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks!

    Not tried it yet but I'm sure it will work just fine.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •