이것은 중복처럼 들릴 수 있지만 여기에 대한 모든 주제를 검색했지만 여전히 운이 없습니다 ... :(
이 코드가 있습니다.
$result = array();
include 'conn.php';
$sql = "SELECT * FROM editlistm WHERE checkvou IN (SELECT checkvou FROM editlist)";
$result = $conn->query($sql);
//$numRows = $result->count($rs);
$numRows = $result->num_rows;
if ($numRows > 0) {
// output data of each row
while($row = $result->fetch_object()) {
array_push($items, $row);
}
echo json_encode($items);
}
conn.php :
$servername = "localhost";
$username = "root";
$password = "";
$dbase = "cadacctg";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbase);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
나는 잘못된 것을 보지 못했지만 계속 말합니다.
'C : ... 11 행에서 비 객체의 속성을 얻으려고합니다'($ numRows = $ result-> num_rows;)
객체로 간주되지 않는 이유는 무엇입니까? 그리고 그것에 대해 무엇을 할 수 있습니까? 미리 감사드립니다 :)
var_dump($result) before $numRows = $result->num_rows;
이것이 거짓이면 쿼리에 문제가있는 것입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다