$result=mysql_query($recent_sql);while ($row = mysql_fetch_array($result)) { $type=$row['type']; //or whatever else you want to do for each row in the result}