JClive
JClive

Reputation: 25

SQL insert within MySQL hosted on a raspberry Pi

I have created a database called fruits within it I have created a table called fruits_info.

With headings of fruits_name VARCHAR(25), fruits_description VARCHAR(75), fruits_price FLOAT.

When I try and insert values to the table I use this function.

INSERT INTO fruits.fruits_info VALUES(`Peaches`, `Fresh peaches from Bengal`, `1.90`);

I then get this error message.

Error 1054 (42s22):Unknown column peaches in field list

Upvotes: 0

Views: 291

Answers (2)

abbas
abbas

Reputation: 228

Use this

INSERT INTO fruits.fruits_info VALUES('Peaches', 'Fresh peaches from 
Bengal', '1.90');

Upvotes: 0

Ashley Medway
Ashley Medway

Reputation: 7301

Instead of ` use '.

INSERT INTO fruits.fruits_info VALUES('Peaches', 'Fresh peaches from Bengal', '1.90');

The backtick (`) is for specifying a column.
The single quote (') is for a value.

Upvotes: 2

Related Questions