What are the differences in using DATE_SUB for date calculations in MySQL versions before and after 5.0?

When using DATE_SUB for date calculations in MySQL versions before 5.0, the function only accepts a single argument for the date interval. However, in MySQL version 5.0 and later, DATE_SUB accepts two arguments - the date and the interval. To solve this issue, you need to provide both the date and the interval as arguments when using DATE_SUB in MySQL versions 5.0 and later.

// Using DATE_SUB in MySQL versions before 5.0
$query = "SELECT DATE_SUB(NOW(), INTERVAL 1 DAY) AS previous_date FROM your_table";

// Using DATE_SUB in MySQL versions 5.0 and later
$query = "SELECT DATE_SUB(NOW(), INTERVAL 1 DAY) AS previous_date FROM your_table";