Reputation: 37
I'm getting a syntax error: Syntax error near 17:38
insert into tbl_otp('mobile', 'otp', 'exp') values (9932111111, 333333, 2019-04-09 17:38:34)
Upvotes: 0
Views: 68
Reputation: 34677
insert into tbl_otp(`mobile`, `otp`, `exp`)
values ('9932111111', '333333', '2019-04-09 17:38:34')
Need to backquote your column names and single-quote your values, though the latter is just to be safe.
Upvotes: 1
Reputation: 8147
put the date value in quotes and remove quotes from column names:
insert into tbl_otp(mobile, otp, exp) values (9932111111, 333333, '2019-04-09 17:38:34')
Upvotes: 0
Reputation: 312259
Single quotes denote string literals, so you shouldn't use them for column names. You should, however, surround the date literal with quotes:
insert into
tbl_otp(mobile, otp, exp) -- no quotes
values (9932111111, 333333, '2019-04-09 17:38:34') -- quotes
Upvotes: 3