DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   MySQL (http://www.daniweb.com/forums/forum126.html)
-   -   Insert doesn't do what it's supposed to (http://www.daniweb.com/forums/thread122707.html)

Icetigris May 6th, 2008 4:37 am
Insert doesn't do what it's supposed to
 
I have a ton of inserts in an sql file that look like this:
INSERT INTO grades (GWid, classid, semester, year, grade, required) 
VALUES(100000089, 'CS210', 'B', 'fall', '2006', 'yes');
but when I get my filled tables, the semester and grades are all null and the year is 0000. Any explanations as to why this would be happening?

I'm using phpMyAdmin 2.6.4-pl4 with MySQL 3.23.32 (maybe higher). It's on a university server so I don't have any choice in the matter or privileges to change anything.
-----------------------

Crap, I just realised that the values are in the wrong order. Problem solved. Tiiiiired...

KenK May 6th, 2008 5:45 pm
Re: Insert doesn't do what it's supposed to
 
Your declared column names and values don't line up correctly. Try this:
INSERT INTO grades (GWid, classid, semester, year, grade, required) 
VALUES(100000089, 'CS210', 'fall', '2006', 'B', 'yes');


All times are GMT -4. The time now is 3:12 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC