What is the correct syntax for using multiple columns in the ORDER BY clause in PHP?
When using multiple columns in the ORDER BY clause in PHP, you need to separate each column with a comma. This allows you to specify the order in which the results should be sorted based on the values in those columns. By using multiple columns in the ORDER BY clause, you can fine-tune the sorting of your query results to meet your specific requirements.
$query = "SELECT * FROM table_name ORDER BY column1, column2";
$result = mysqli_query($connection, $query);
while($row = mysqli_fetch_assoc($result)) {
// Process each row
}