PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, February 22, 2022

[FIXED] Unexpected Beginning of statement - Issue with Syntax?

 February 22, 2022     phpmyadmin, sql     No comments   

Issue

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


Solution

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')


Answered By - uxmal
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing