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:


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....



11 Years
Discussion Span
Last Post by Memento

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:

[B]UPDATE tbl_studentgrade SET
grade = grade || ' 78'[/B]
  [B]WHERE student = 'Some Student ID'[/B]

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,

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.