How can the mysql_fetch_assoc() function be used in a loop to retrieve multiple rows from a database query?
To retrieve multiple rows from a database query using the mysql_fetch_assoc() function in a loop, you can fetch each row one by one until there are no more rows left to fetch. You can achieve this by using a while loop that continues fetching rows as long as there are rows available. Each fetched row can then be processed or stored as needed.
// Assume $result contains the result of a database query
while ($row = mysql_fetch_assoc($result)) {
// Process or store the fetched row
echo $row['column_name'] . "<br>";
}