Hey all!
I am currently having a problem separating the data i have displayed using a random SQL function.
My SQL statement looks like this:
$query2 ="SELECT DISTINCT * FROM table ORDER BY rand() LIMIT 0 , 3;";
$result2 = mysql_query($query2);
This is working fine and producing 3 random results like i want it to. The problem i am having is separating the strings into single variables. If i run the code:
for ($i = 0; $i < mysql_num_rows ($result2); $i++)
{
$name = mysql_result ($result2, $i, "TestName");
echo "$name";
}
I am ending up with "row1row2row3" being displayed. How do i separate each row so that i can display them individually?
Thanks in advance
GavW