Papulate randomly a PHP table from an SQL Table.

Discussion in 'Databases' started by Wizeman29, Aug 24, 2010.

  1. #1
    Hello! HOw do I populate Randomly a PHP Table with data from a Table on SQL database according a Row???? (i need to show 15 registered users every 24 hours in a table next to the registration form so people can select they Referal if they don't have any). (Referal is a required field).
     
    Wizeman29, Aug 24, 2010 IP
  2. TheWiseGuy

    TheWiseGuy Member

    Messages:
    113
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #2
    use this query to pull 15 random users

    select * ( or whatever fields you need) from table order by rand() limit 15;

    if you need to have them stick for 24 hours save the output to a txt file or any other way you prefer because this will pull 15 random users every time you run it, not the same 15 users
     
    TheWiseGuy, Aug 27, 2010 IP