What is the correct way to retrieve and display individual rows from a MySQL query in PHP?

When retrieving individual rows from a MySQL query in PHP, you need to use the `fetch` method to fetch one row at a time from the result set. You can then access the columns of the row using associative or numeric indices. To display the data, you can simply echo out the values of the desired columns.

// Assuming $result is the result of a MySQL query
$row = $result->fetch(PDO::FETCH_ASSOC); // Fetching a row as an associative array

echo $row['column_name']; // Displaying a specific column value