What are the advantages and disadvantages of using "*" versus specifying individual columns in SQL queries in PHP?

When writing SQL queries in PHP, using "*" to select all columns can be convenient but may lead to performance issues and potential data leakage. It is generally recommended to specify individual columns to improve query efficiency and reduce the risk of exposing sensitive information.

// Instead of using "*", specify individual columns in your SQL query
$sql = "SELECT column1, column2, column3 FROM table_name WHERE condition = 'value'";
$result = mysqli_query($connection, $sql);

// Process the query result as needed
if (mysqli_num_rows($result) > 0) {
    while ($row = mysqli_fetch_assoc($result)) {
        // Access specific columns using $row['column_name']
    }
}