I am very new to PHP and I have a test project:
I want to make the code more efficient as it takes some time to generate.
Thanks a lot, Nat
The code it uses is as follows:
$result1 = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS `Rows`, `1` FROM `things` GROUP BY `1` ORDER BY RAND() LIMIT 0 , 1"));
$result2 = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS `Rows`, `2` FROM `things` GROUP BY `2` ORDER BY RAND() LIMIT 0 , 1"));
$result3 = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS `Rows`, `3` FROM `things` GROUP BY `3` ORDER BY RAND() LIMIT 0 , 1"));
$result4 = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS `Rows`, `4` FROM `things` GROUP BY `4` ORDER BY RAND() LIMIT 0 , 1"));
echo $result1["1"];
echo " ";
echo $result2["2"];
echo " ";
echo $result3["3"];
echo " ";
echo $result4["4"];
mysql_close($con);
?>
I am assuming good faith & cleaned up the code presented the best way possible using the methods you want to use.