MySQL Forums
Forum List  »  Newbie

Re: C mysql-insert in DATE and TIME field
Posted by: Phillip Ward
Date: December 08, 2014 06:59AM

Date and Time literals, like strings, have to wrapped in single quotes:

INSERT INTO dht22_test.temp_humid VALUES ( NULL, 18.9, 45.4, 19.50, '2014-12-08', '01:28:11' )

or better still, if your application language supports them, use Parameterised Queries to handle this for you.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: C mysql-insert in DATE and TIME field
December 08, 2014 06:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.