skip to Main Content

Currently using PHPMyAdmin, and I am trying to insert some data into a SQL Table.

The error that I am getting is Unexpected Beginning of Statement (near 'brand')
Brand is on the second line of the SQL statement.

The data that I am trying to enter:

INSERT INTO 'vehicles'
('reg_no', 'category', 'brand', 'description', 'dailyrate') VALUES
('BA5923W', 'car', 'Toyota', 'black 4 door 2.6 engine ', '9.99'),
('BA6611A', 'car', 'NISSAN ', '4 Door Saloon, Automatic', '9.99'),
('BM1245a', 'car', 'Golf', NULL, '9.00'),
('GA5955E', 'truck', 'NISSAN CABSTAR 3.0', 'Lorry, Manual ', '18.99')

cheers

2

Answers


  1. Chosen as BEST ANSWER

    Fixed. I was not closing the block of SQL code that created the table, which comes before this.


  2. You have an syntax error at you query.
    For columns names you should use Grave Accent ` char like

    (`reg_no`, `category`, `brand`, `description`, `dailyrate`)
    

    and for data line Apostrophe ' char like

    ('BA5923W', 'car', 'Toyota', 'black 4 door 2.6 engine ', '9.99')
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search