You create an SQL statement to do so and then call an SQL API to tell the SQL server to execute your statement.
Noah Roberts
2010-07-08 20:28:55
You create an SQL statement to do so and then call an SQL API to tell the SQL server to execute your statement.
First, you've got an sql-injection attack waiting to happen. Had to be said.
Ok, that huge problem swept aside, you can either convert the date to a MySQL format (such as a UTC timestamp then converted again with FROM_UNIXTIME()), or tell MySQL how to convert it using STR_TO_DATE(). Both are documented in the MySQL manual, under the section "Date and Time Functions".