PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$fields = array('website','website2','website3','website4');
$rand = rand(0,4);
$sql = "SELECT * FROM `table` ORDER BY RAND() LIMIT 1";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$website = $row[$fields[$rand]];
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Thanks guys, Scott's was what I was looking for. How to I make it so that it only selects it if the field isn't empty? All of the `website` cells have a value but not alll of the website1, website2, etc have values. Some are null by default or empty if the user emptied it.