我在这里尝试了许多q& a但我仍然收到警告:mysqli_num_rows()期望参数1为mysqli_result,布尔值在
中给出这是我的代码;
<?php
include 'conn.php';
$teble = $_SESSION['cunn'];
echo $teble;
$sqry = "select * from" .$teble;
$result = mysqli_query($connect,$query);
if (mysqli_num_rows($connect,$sqry);
while($row = mysqli_fetch_assoc($result))
echo $teble;
工作正常但$sqry
是我的问题
如果我用实际的表名替换变量,它就可以工作。
答案 0 :(得分:0)
$sqry = "select * from" .$teble;
需要在from和table name之间添加空格。
$sqry = "select * from " .$teble;
答案 1 :(得分:-1)
我认为你错过了一个空间&#34; From&#34;尝试更改此行代码:
$sqry = "select * from" .$teble;
要
$sqry = " select * from " .$teble;