0

I'm using mdb2 prepare for creating a select query with date_format, and I need to receive datetime in format "%Y-%m-%d %H:%i:%s". When using such format with mdb2 query - there are no problems, but when i'm trying to prepare this query, I get a syntax error because of colons in it. Is there a way to escape these colons?

Voider
  • 11
  • 1

1 Answers1

0

It's just a MySQL timestamp string. You don't escape anything. It just needs to be quoted. e.g.

INSERT ... VALUES ('2014-06-10 13:47:00', 2014-06-10 13:47:00)

is seen as a timestamp, and some mathematical operations (2014 minus 6 minus 10 and some syntax error bare values).

Marc B
  • 356,200
  • 43
  • 426
  • 500