List:General Discussion« Previous MessageNext Message »
From:Micheal Mc Evoy Date:April 11 1999 3:39am
Subject:Re: Biggest ever newbie question - INSERT
View as plain text  
On Sun, 11 Apr 1999, Eric Dahnke wrote:

>Date: Sun, 11 Apr 1999 00:29:19 -0300
>From: Eric Dahnke <edahnke@stripped>
>To: mysql@stripped
>Subject: Biggest ever newbie question - INSERT
>
>Hello kind list,
>
>I'm very new to SQL, sorry if this an inapropriate question.
>
>I created a table as follows.
>
>CREATE TABLE test_table (field1 CHAR(10) NOT NULL,
>	field2 CHAR(10) NOT NULL);
>
>When I try to insert data via
>
>INSERT INTO test_table (field1, field2) VALUES (red, blue);
>
>why does MySQL think that red and blue are columns?
>
>ERROR 1054: Unknown column 'red' in 'field list'
>
>
>(I did notice that I can input numbers instead of red and blue and the
>data is accepted)
>Many thx, - eric

Eric,
Character strings need to be enclosed in single quotes.
I would recommend that you pick up a good intro to SQL book.

Micheal



---
Micheal Mc Evoy                                    mjmc@stripped
                                             http://www.whitepine.com

WhitePine Consulting supports the Free Software Foundation and it ideals
by promoting, using and supporting Open Source, GNU and GPL'd Software.

Thread
Biggest ever newbie question - INSERTEric Dahnke11 Apr
  • Re: Biggest ever newbie question - INSERTMicheal Mc Evoy11 Apr