-4

I've currently entered 10 links into a csv file and uploaded. the column is called links and the table is called landmarks. I've only ever selected things from the database rather than randomly generating a link. I want to have a button on my page that you click and it can randomly select a link from the database. How do I do that, and then how do I make it so that when it is randomly generated that page will then open?

Dharman
  • 30,962
  • 25
  • 85
  • 135
5dollar
  • 7
  • 2

1 Answers1

0

You can add: order by rand() to your query or you can use a PHP loop to take the 10 data points from your db into an array then use rand(0,9) to get a random ID from your array to output.

the_pete
  • 822
  • 7
  • 19