tags:

views:

54

answers:

2
Notice: 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 
'usage VALUES('16','143','ew','weff','25-3-2010','8.00 AM','22-3-2010','10.00 AM''

at line 1 in:

INSERT INTO usage 
VALUES('16'
      ,'143'
      ,'ew'
      ,'weff'
      ,'25-3-2010'
      ,'8.00 AM'
      ,'22-3-2010'
      ,'10.00 AM'
      ,'wfsdc'
      , '34'
      ,' frsdfr '
      ,'TEST 1'
      ,'ISMAIL SALLEH'
      ,'efsdc'
  )

I've no idea where is the error... I'm staring on this for 2 hours, but really cannot find the error.

+6  A: 

Try:

INSERT INTO `usage` VALUES ....

You simply need to wrap the table name in backticks, because USAGE is a reserved word in MySQL.

Source: MySQL Docs: Reserved Words

Daniel Vassallo
when i run at sql..the error become near 'usage VALUES('16','143','ew','weff','25-3-2010','8.00 AM','22-3-2010','10.00 AM'' i dont know to solve it...i 've compare to the other code...but it look similar...
wrap the table name in backticks, not quotes.INSERT INTO ``usage`` (not 'usage')
Rob
ok..it almost done..it the new error occurs Column count doesn't match value count at row 1 in INSERT INTO `usage` VALUES('16','143','ew','weff','25-3-2010','8.00 AM','22-3-2010','10.00 AM','wfsdc', '34',' frsdfr ','TEST 1','ISMAILwhat is the coloums count?
thanks daniel...the error because there where 'status' field in the table...is it possible if i want to insert data into table with 1 field without data..
@ejah85: I'm glad it worked :)
Daniel Vassallo
A: 

Have you tried retyping it from scratch in case you put the line together using cut and paste and maybe accidentally included an invisible control character which makes the SQL parser choke...?

p.marino
i also think like that...but i've 2time retyping it...and really2 mess with this...