这是我的search.php代码。我正在尝试搜索,用户将在其中输入订户ID,并显示接受的订户ID的名字,姓氏和地址
<!doctype html>
<html>
<body>
<?php
$conn=mysqli_connect("localhost","root","kuyahajji","steve");
if (isset($POST['submit-SubscriberID'])) {
$choice = mysqli_real_escape_string($conn,$_POST['$SubscriberID']);
$sql = "SELECT * FROM property WHERE SubscriberID='$choice'";
$result = mysqli_query($conn,$sql);
$queryResult = mysqli_num-rows($result);
if ($queryResult > 0) {
while($row = mysqli_fetch_assoc($result))
{
echo $result;
}
}
else {
echo "0 results";
}
}
?>
</body>
</html>
答案 0 :(得分:0)
$row
是数组。要输出所需的密钥,请使用[]
表示法:
echo $row['FirstName'] . $row['LastName'];
函数的正确名称是mysqli_num_rows
(所有下划线)。