如何根據USER SCORE字段以最接近SCORE BRAND字段值的規定確定表用戶的RESULTS字段。如何在PHP中找到最接近的值
這是表品牌
<table>
<tr>
<th>BRAND NAME</th>
<th>SCORE BRAND</th>
</tr>";
$sql = mysql_query("SELECT * FROM brand");
while($m=mysql_fetch_array($sql)){
echo "<tr>
<td>$m[brand_name]</td>
<td>$m[score]</td><tr>";
}
</table>
這是表的用戶
<table>
<tr>
<th>USER NAME</th>
<th>SCORE USER</th>
<th>RESULT</th>
</tr>";
$sql2 = mysql_query("SELECT * FROM users");
while($u=mysql_fetch_array($sql2)){
echo "<tr>
<td>$u[username]</td>
<td>$u[score]</td>
<td> ??? </td>
<tr>";
}
</table>
你嘗試過什麼到目前爲止? –
如果用戶評分爲「55」,那麼結果如何? 'Axa'或'Autocilin'? –
即時通訊只是嘗試與其他條件,但不工作。 55應該是autocilin。 –