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

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:

[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,
Dan

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.