Results 1 to 13 of 13
Sep 21, 2001, 10:36 #1
- Join Date
- Jul 2001
- The Netherlands
- 0 Post(s)
- 0 Thread(s)
Selecting a random id from a database
I am trying to build a script, which selects a random ID from my MySQL database. The ID's are all integers, ranging from 1 to whatever ID is the last is the database.
I have been trying to get a script running that selects a random number out of this heap of integers. This is what I have so far:
$dbx = mysql_connect() or die("Could not connect to database");
mysql_select_db (Jokes, $dbx);
$sql = "SELECT MAX(id) FROM Jokes";
$result = mysql_query($sql);
Thanks in advance .