How can using quotes around the NOW() function in a MySQL query affect the data being inserted into a DATETIME field?

Using quotes around the NOW() function in a MySQL query will insert the literal string "NOW()" into the DATETIME field instead of the current date and time. To solve this issue, remove the quotes around the NOW() function in the query so that it is interpreted as a function call rather than a string.

// Incorrect way with quotes around NOW() function
$query = "INSERT INTO table_name (datetime_column) VALUES ('NOW()')";
// Correct way without quotes around NOW() function
$query = "INSERT INTO table_name (datetime_column) VALUES (NOW())";