下面的代码应该从personprofile表中将数据(名字,姓名,姓氏,医疗保险)插入organandtissuedonationcommittee表以及"器官捐赠" if prioritylvl == 1和()中的数据相同以及" pending"当prioritylvl == 2/3时 请帮助我,我无法找出我做错了什么。这是代码
// check the prioritylvl if 1 insert organstatus as transplant completed if 2 or 3 then organstatus as pending
$sqlpersonprofile= "SELECT firstname,fathername,lastname,medicalinsurance,prioritylvl,admissionreason FROM personprofile";
$patients= mysqli_query($link,$sqlpersonprofile);
$processpriority= mysqli_fetch_assoc($patients);
if($processpriority['prioritylvl'] == 1 && $processpriority['admissionreason'] == 5 ){
//dont forget to add the organ status
$sqlcommittee= 'INSERT INTO organandtissuedonationcommittee(firstname,fathername,lastname,insurance,organstatus)
VALUES("$processpriority['firstname']","$processpriority['fathername']","$processpriority['lastname']","$processpriority['medicalinsurance']","Organ donated")';
$committee = mysqli_query($link, $sqlcommittee);
if(!$committee){
echo 'Not inserted';
}
}
if($processpriority['prioritylvl'] == 2 || $processpriority['prioritylvl'] == 3 && $processpriority['admissionreason'] == 5 ){
//dont forget to add the organ status
$sqlcommittee= 'INSERT INTO organandtissuedonationcommittee(firstname,fathername,lastname,insurance,organstatus)
VALUES("$processpriority['firstname']","$processpriority['fathername']","$processpriority['lastname']","$processpriority['medicalinsurance']","Pending")';
$committee = mysqli_query($link, $sqlcommittee);
if(!$committee){
echo 'Not inserted';
}
}