I have 2 tables.
contacts and complaints.
contacts has 3 columns:
contact_id, contact_name, score
complaints has 4 columns:
complaint_id, contact_id, score_deduction, complaint_type
I am able to obtain value $_GET['complaint_id']
from previous page.
What i am trying to do is delete the record with that particular complaint_id and get the value of complaints.score_deduction and add it back to contacts.score.
I have spent hours and cant seem to figure it out.
Please help.
if (isset($_GET['complaint_id'])) {
record_set('complaints',"SELECT * FROM add_complaints WHERE complaint_id = ".$_GET['complaint_id']."");
$contact_id = $row_complaints['contact_id'];
record_set('contact',"SELECT * FROM contacts WHERE contact_id = $contact_id");
$score = $row_contact['contact_score'];
echo $score;
}