任何人都可以帮我看看吗?我想取一个数字,但我得到了这个错误
解析错误:第12行的E:\ Software \ Xampp \ htdocs \ pme \ main \ user_online.php中的语法错误,意外';',期待']'
这是我的代码
<?php
include '../config.php';
$sql= mysqli_query($connection,' select * from session');
$row = mysqli_num_rows($sql);
while($extract = mysqli_fetch_array($sql)){
echo
"<div class='left-total-user-online' id='left-total-user-online'>
total user online : " .$extract[$row = mysqli_num_rows($sql);]. "</div>";
}
?>
答案 0 :(得分:2)
你的生活比必要的复杂得多。所有你需要编码的是
<?php
include '../config.php';
$sql= mysqli_query($connection,' select * from session');
$row = mysqli_num_rows($sql);
echo "<div class='left-total-user-online' id='left-total-user-online'>
total user online : $row</div>";
}
?>