User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 423,229 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,931 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 407 | Replies: 1
Reply
Join Date: Sep 2007
Posts: 9
Reputation: Icetigris is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Icetigris's Avatar
Icetigris Icetigris is offline Offline
Newbie Poster

Insert doesn't do what it's supposed to

  #1  
May 6th, 2008
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...
Last edited by Icetigris : May 6th, 2008 at 4:55 am. Reason: fixed problem
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2008
Posts: 4
Reputation: KenK is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
KenK KenK is offline Offline
Newbie Poster

Re: Insert doesn't do what it's supposed to

  #2  
May 6th, 2008
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');
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 9:15 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC