What is the potential issue with using SELECT * in a MySQL query in PHP?

Using SELECT * in a MySQL query can potentially retrieve more data than necessary, leading to increased network traffic and slower query execution. It's best practice to explicitly specify the columns you want to retrieve to improve performance and reduce the chance of unexpected data changes affecting your code.

<?php
// Specify the columns you want to retrieve instead of using SELECT *
$query = "SELECT column1, column2, column3 FROM table_name";
$result = mysqli_query($connection, $query);

// Fetch and process the results
while ($row = mysqli_fetch_assoc($result)) {
    // Process the data as needed
}
?>