Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MYSQL Query

Status
Not open for further replies.

Filip Boga

Technical User
Sep 14, 2019
1
AL
Hi brothers
Im newbie in databases.
im trying to insert one query in database but keeps showing error

INSERT INTO `Options` (` Name`, `Surname`,` Grade`, `Address`,` City`) VALUES
(‘Adi’, ‘Test’, ‘ 2 ‘, ”, NULL),
(‘Andy’ , ‘User’, ‘ 100500 ‘, ”, NULL);

what i have done wrong?
 
Hi

Is quite impossible to help if you share no information about the table structure and the received error message.

Filip Boga said:
[pre]INSERT INTO [green]`Options`[/green] [teal]([/teal][green]`[highlight] [/highlight]Name`[/green][teal],[/teal] [green]`Surname`[/green][teal],[/teal][green]`[highlight] [/highlight]Grade`[/green][teal],[/teal] [green]`Address`[/green][teal],[/teal][green]`[highlight] [/highlight]City`[/green][teal])[/teal] VALUES
[teal]([/teal][highlight red]‘[/highlight]Adi[highlight red]’[/highlight][teal],[/teal] [highlight red]‘[/highlight]Test[highlight red]’[/highlight][teal],[/teal] [highlight red]‘[/highlight] [purple]2[/purple] [highlight red]‘[/highlight][teal],[/teal] [highlight red]”[/highlight][teal],[/teal] NULL[teal]),[/teal]
[teal]([/teal][highlight red]‘[/highlight]Andy[highlight red]’[/highlight] [teal],[/teal] [highlight red]‘[/highlight]User[highlight red]’[/highlight][teal],[/teal] [highlight red]‘[/highlight] [purple]100500[/purple] [highlight red]‘[/highlight][teal],[/teal] [highlight red]”[/highlight][teal],[/teal] NULL[teal]);[/teal][/pre]
Two questions in meantime :
[ul]
[li]Are you sure those column names were declared with [highlight]leading space[/highlight] ?[/li]
[li]Are you sure in reality you delimited string values with apostrophe ( [tt]'[/tt] ) characters, not [highlight red]fancy quotes[/highlight] ?[/li]
[/ul]

Feherke.
feherke.github.io
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top