Sometimes you want display random information from your database. I had a hardtime figuring out how to do is with php. I found the RAND() functions works greate with MySQL. Here I have create a snippet to help give you a sample code script:

The following example will display one output from your table. You can display multiple fields by doing a loop.

example: Make sure to provide your database information like your username, password, etc..

# Random Snippet Code Sample by
$db_host = 'localhost';
$db_username = 'myusername';
$db_password = 'mypassword';
$db_dbname = 'mydatabase_name';

$database = mysql_connect($db_host, $db_username, $db_password);

$sql = "SELECT *  FROM table_name ORDER BY RAND()";
$result = mysql_query($sql ,$db);
$myrow = mysql_fetch_array($result);

echo $myrow[field_name];


* make sure to edit the script and provide your correct table_name and field_name from your table, ( i used table_name and field_name as an example)