What are some common methods for customizing the ORDER BY clause in PHP queries?

When customizing the ORDER BY clause in PHP queries, some common methods include specifying the column to sort by, the direction of the sorting (ASC for ascending or DESC for descending), and using dynamic variables or user input for more flexibility. Example:

// Specify the column to sort by and the direction
$column = 'name';
$direction = 'ASC';

// Build the query with the customized ORDER BY clause
$sql = "SELECT * FROM table_name ORDER BY $column $direction";

// Execute the query and fetch the results
$result = $conn->query($sql);