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

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -