为什么我无法获得回音? echo $tot
给了我3
出于某种原因,$ row变量在echo 'wrong'
if($row < $b)
<?php
if($row < $b) {
echo "good";
} else { echo "wrong"; }
$sql=mysql_query("SELECT ID FROM emp WHERE user='$login_session'"); // its currently zero
$row=mysql_num_rows($sql);
$b = 3;
$tot=$b - $row;
echo $tot;
?>
答案 0 :(得分:0)
使用此:
<?php
$sql=mysql_query("SELECT ID FROM emp WHERE user='$login_session'"); // its currently zero
$row=mysql_num_rows($sql);
$b = 3;
$tot=$b - $row;
echo "$tot";
if($row < $b) {
echo "good";
} else { echo "wrong"; }
?>
您一直在尝试输出未定义的变量。
你的代码是:
Ouput undefined variables
Assign something to this variables
我的代码顺序是:
Assign something to this variables
Ouput undefined variables