我有一個表有一個名爲result的列,結果是一個銀行通過post方法發送給我的變量...並且值爲:1,2 ... so當銀行向我發送1時,我想向用戶展示其接受的內容,如果是2,則向用戶展示其被拒絕的內容...我需要一個如果其他公式的公式。更改表中顯示的結果
<?php
$id_get= $_POST['id_get'];
$trans_id = $_POST['trans_id'];
$servername = "localhost";
$username = "blah";
$password = "blah";
$dbname = "blah";
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
?>
<?php
mysqli_query($conn, "SET NAMES 'utf8'");
$result = mysqli_query($conn,"SELECT id_get, trans_id, result FROM users");
echo "<table border='1' width='800' align='center'>
<tr>
<th>ID</th>
<th>transaction Result</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr align='center'>";
echo "<td width=10%>" . $row['id_get'] . "</td>";
echo "<td width=10%>" . $row['trans_id'] . "</td>";
echo "</tr>";
}
echo "</table>";?><br>
<div align="center">
<?php
mysqli_close($conn);
?>