php - Apparent Syntax Error -


i first admit bit of newbie when comes php having frustrating issue trying submit data collected form (currently preset in query) , send database, problem saying syntax incorrect, have found not , not have access modify database university server.

mysql_query("insert 'nnproduct' values ('', 'something','something','something',5,5,'$image_name', $producttypeid)"); 

the error having

invalid query: have error in sql syntax; check manual corresponds mysql server version right syntax use near ''nnproduct' values ('', 'something','something','something',5,5,'aaron.jpg', 1)' @ line 1

you cannot wrap table name in quotes. need use ticks (or no ticks or quotes):

mysql_query("insert `nnproduct` values ('', 'something','something',...                        ^^^^^     ^^^^                             here 

Comments

Popular posts from this blog

c# - OpenXML hanging while writing elements -

php - regexp cyrillic filename not matches -

sql - Select Query has unexpected multiple records (MS Access) -