I prefer to use fetch_assoc(), so that the array keys are the field names, not just 0th based numeric indexes, making the code a bit more readable.
foreach($array1 as $row) {
echo $row['user_name']."<br />\n";
}
// instead of...
foreach($array1 as $row) {
echo $row['2']."<br />\n";
}
Also, the associative keys won't change if you add or subtract a selected column in the query.