when
$query = 'SELECT * FROM users';
and there are multiple columns/rows, does mysql_fetch_assoc($result)
return a two-dimensional array?
Can I draw each row by simply saying: array_pop(mysql_fetch_assoc($r))
thanks!
mysql_fetch_assoc returns an associative array (an array with the selected column names as keys), one row at a time until there are no more rows in the result of the query. Call it in a loop to work with a row at a time:
while ($row = mysql_fetch_assoc($result)) {
echo $row["username"];
echo $row["email"];
}
(Assuming username and email are columns in the users table).