gpt4 book ai didi

php - 如何使我的数组病人[6]等于true并且输出应该被批准

转载 作者:行者123 更新时间:2023-11-29 21:11:47 25 4
gpt4 key购买 nike

如何使我的数组病人[6]等于true(true,意味着有数据,如果病人[0]中有数据,那么病人[6]应该有输出“APPROVED”,如果有患者[0]中没有数据,那么患者[6]应该输出“DISAPPROVED”

这是我的代码...我将如何做到这里...

    $sql = "select patientid, firstname, lastname, gender, patienttype, philhealth, status from patients where lastname LIKE '%" . $_POST["key"] . "%' or philhealth LIKE '%" . $_POST["key"] . "%' ";
$result = mysql_query($sql, $connection);
$rownum = 0;
$bgcolor = "";
while($patient = mysql_fetch_array($result))
{
$rownum += 1;
if($rownum == 2)
{
$bgcolor = "#FFF";
$rownum = 0;
}
else
{ $bgcolor = "#f9f9f9"; }

echo "
<tr id='" . $patient[0] . "' style='background: " . $bgcolor . "' onclick='openphilhealthapproval() '>
<td id='td27_cell1' style='height: 25px;'>" . $patient[5] . " </td>
<td id='td27_cell2' style='height: 25px;'>" . $patient[0] . "</td>
<td id='td27_cell3' style='height: 25px;'>" . $patient[1] . " " . $patient[2] . "</td>
<td id='td27_cell4' style='height: 25px;'>" . $patient[3] . "</td>
<td id='td27_cell5' style='height: 25px;'>" . $patient[4] . "</td>
<td id='td27_cell6' style='height: 25px;'>" . $patient[6] . "</td>
</tr>
";
}

最佳答案

你可以使用这个:($病人[0]!="")?:$病人[6]="已批准":$病人[6]="未批准"

关于php - 如何使我的数组病人[6]等于true并且输出应该被批准,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36315154/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com