You know what is wrong with this query? I echo and query

you know what is wrong with this query? I echo and query… I use PHP PDO

time() save in mysql what type must be the db field…?


INSERT INTO table('username', 'carid', 'tries', 'time_retry', 'IP', 'sys_update_date') VALUES ('yyy', 123456, 5, 1491378965, '38.34.44.255', '2017-04-04 17:56:05')

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''username', 'carid', 'tries', 'time_retry' 'IP', 'sys_update_date') VALUES ('tes' at line 1

Have you tried it without quotes round username, carid, etc?

table is a reserved word. If you’re going to use a reserved word as a name (which is a bad idea, almost 100% of the time), you’ve got to surround it in quotes.

INSERT INTO 'table' ('username', 'carid', 'tries', 'time_retry', 'IP', 'sys_update_date') VALUES ('yyy', 123456, 5, 1491378965, '38.34.44.255', '2017-04-04 17:56:05')
1 Like

is dummy text hiding real

yes i tried

if ($conn->query($q2) === TRUE) { // I used this to execute // also above this there is a Select same table…

success fields names ALL without quotes

1 Like

That would be the “etc”! :smiley:

It could be what you’re using for the single quote.

` (to the left of the 1 on the US QWERTY keyboard) is not the same as ’ (under the double quote symbol on the US QWERTY keyboard). One works in mySQL, one doesn’t,

NOOOOOOOOOOOOOOOOOOOOOOoooooooooooooo…

please… do not confuse people further by misidentifying backticks

backticks are not single quotes

Tomato/tomahto :smiley: :stuck_out_tongue:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.