如何解决“试图获取非对象的属性”?

时间:2019-10-17 18:23:54

标签: php

$sql= "SELECT * FROM tableName";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
  // output data of each row
  while($row = $result->fetch_assoc()) {
    echo "<br> id: ". $row["id"]. " - Name: ". $row["name"]. " " . $row["email"] . "<br>";
  }
} else {
   echo "0 results";
  }

'

0 个答案:

没有答案