mysql - INSERT SQL error -


i have in script:

$db->q("insert 'keys' (key,grupo,dias) values ('$key','vip',$love);"); 

which generates sql this

insert 'keys' ('key','grupo','dias') values ('35f3','vip',28) 

but

you have error in sql syntax; check manual corresponds mysql server version right syntax use near ''keys' ('key','grupo','dias') values ('35f3','vip',28)' @ line 1

i'm adding screenshot of table's structure: http://i.stack.imgur.com/lukfm.png

enter image description here

thanks ur help!

tables names identfiers not string literals. in case escape, should use backticks,

insert `keys` (`key`,`grupo`,`dias`) values ('35f3','vip',28) 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -