944,137 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Unsolved
  • Views: 9123
  • ColdFusion RSS
Jan 4th, 2007
0

How to insert data in one column in database?

Expand Post »
Hi 2 all experts out there....

Im begging all of you to help me in my problem... Please... please... please....

my problem goes like this:

if i have students having a grades of:

First Grading

James Tan 88

Jaime Abba 85

Grace Sasa 78

Gerald Hulife 96

Mark Reyes 85

then submit it... and retrieve for adding again the:


Second Grading

James Tan 88 78

Jaime Abba 85 90

Grace Sasa 78 85

Gerald Hul 96 85

Mark Reyes 85 90

then submit again... and retrieve for adding again the 3rd and 4th grading:



How will I insert that in one column but different fields in a database?

Like this:

tbl_studentgrade

Name 1st 2nd 3rd 4th Ave

James Tan 88 78

Jaime Abba 85 90

Grace Sasa 78 85

Gerald Hul 96 85

Mark Reyes 85 90


If anyone knows how, Please help me....

Tnx...

Reyn
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
anyer_ast!g is offline Offline
5 posts
since Sep 2006
Jan 14th, 2007
0

Re: How to insert data in one column in database?

Hello,
If I understand you correctly, you are trying to store multiple grades in one text/varchar column.

To do this, the first grade would be put into the database using an INSERT statement with each consecutive grade getting inserted by an UPDATE statement because we are updating an existing record. Try doing something such as:

UPDATE tbl_studentgrade SET
grade = grade || ' 78'

WHERE student = 'Some Student ID'

Note that the new grade is padded with a leading space.

A more sophisticated approach might be to separate the student, grade, and assignment into separate tables.

Good luck,
Dan
Reputation Points: 12
Solved Threads: 0
Light Poster
Memento is offline Offline
30 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ColdFusion Forum Timeline: ADOBUG
Next Thread in ColdFusion Forum Timeline: help! need to accumulate total





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC