Hi, I have a script that allows me to delete multiple rows in one of my database tables with checkboxes.
The problem is that the table has a primary key made of two columns: student ID and detail ID.
Student ID's may hence show up more than once with different detail ID's.
I have the checkbox set up to send the student ID with the box, but because of this, when I delete it deletes the entire student ID from the table, and hence every occurrence of it rather than just the single row I want.
I've only figured out one way to send both the Student ID and the Detail ID with the checkbox, and here it is:
while(OCIFetchInto($q, $arrGrades, OCI_ASSOC+OCI_RETURN_NULLS)){
$sid=$arrGrades['STUDENT_ID'];
$did=$arrGrades['DTL_ID'];
$name="" . s . "" . $sid . "" . d . "" . $did ."";
echo '<tr height="28"><td><p align="center"><input type="checkbox" value="';
echo $name;
echo'" name="DeleteGrades[]"></td></tr>';
This way it makes the value of the checkbox a string with the letter s, then the value of the student ID, then the letter d, and then the value of the detail ID.
For instance, the checkbox for the row with student ID 7 and Detail ID 11 would have the value "s7d11"
My question is how do I parse this in the processing file? Basically I want to extract just the '7' as the student ID, and the 11 as the detail ID.
I'm doing this in oracle, but any general help is more than welcome as well, thanks.