What is the correct date format to use when inserting dates into a MySQL database for sorting in PHP?

When inserting dates into a MySQL database for sorting in PHP, it is recommended to use the "YYYY-MM-DD" format as it is the standard date format recognized by MySQL. This format ensures that dates are stored in a consistent manner and can be easily sorted and queried in the database.

$date = date("Y-m-d"); // Get the current date in YYYY-MM-DD format
$query = "INSERT INTO table_name (date_column) VALUES ('$date')";
$result = mysqli_query($connection, $query);