SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Dec 12, 2008, 12:55 #1
- Join Date
- Sep 2008
- Posts
- 977
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
create and insert throwing error.
Hi,
Getting back into this after a couple of weeks away.
I am creating a table and then trying to insert values. MySQL throws the error 1136, and says that column count doesn't match value count at row 1.
what am I missing please?
Code:CREATE TABLE IF NOT EXISTS vat_rates ( vat_rate decimal(5,2) NOT NULL , date_from date NOT NULL , date_to date default NULL , PRIMARY KEY (vat_rate,date_from) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO vat_rates (vat_rate) VALUES ('17.5', '2008-04-05', ''), ('15.00', '2008-12-01', '');
-
Dec 12, 2008, 13:33 #2
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
this one's easy, bazz, you just gots to think a little harder
"column count doesn't match value count"
let's see...Code:INSERT INTO vat_rates (vat_rate)
Code:VALUES ('17.5', '2008-04-05', '')
see it now?
-
Dec 12, 2008, 13:40 #3
- Join Date
- Sep 2008
- Posts
- 977
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yep I got it, just now, when I hit the same issue with another table. I'll have to build up my momentum again.
Thanks Rudy.
Bookmarks