What are the potential pitfalls of storing dates without the year in a database for daily retrieval in PHP?

Storing dates without the year in a database for daily retrieval can lead to ambiguity and potential errors when trying to retrieve and manipulate the data. To solve this issue, it is recommended to store the complete date including the year in the database to ensure accurate and precise data retrieval.

// Storing dates with year in the database
$date = '2022-10-15';
// Retrieve data using the complete date
$query = "SELECT * FROM table WHERE date_column = '$date'";
$result = mysqli_query($connection, $query);