如果表总余额中的total_money
,我应该完成以下条件
大于10
才能显示确切的用户消息,但不起作用
任何语法或逻辑错误? 该怎么解决?
<?php
$db = mysqli_connect('localhost', '********', '**********', '*********');
$user_check_query = "SELECT total_money FROM total_balance WHERE username = '" . $_SESSION['username'] . "' ";
$result = mysqli_query($db, $user_check_query);
$row = mysqli_fetch_array($result);
if($result >10){
echo "Enough";
} else {
echo "Not Enough Money";
}
?>
表: total_balance
ID username total_money
+----+--------------+---------------+
|1 | John | 100 |
+----+--------------+---------------+
|2 | Alex | 10 |
+----+--------------+---------------+
|3 | Pani | 5 |
+----+--------------+---------------+
答案 0 :(得分:0)
更改
.then((res) => {
console.log("Axios post is working")
console.log("Something: " + res);
console.log(res.data);
})
到
if($result >10){
echo "Enough";
} else {
echo "Not Enough Money";
}