lets see code
public function chekfactor( $factor,$user) {
$arrfactor=preg_split('/<td>/',$factor);
$arrusers=preg_split('/<td>/',$user);
$tedstore=count($arrusers) ;
$tedkala=count($arrfactor) ;
$inttedstore=(int) $tedstore;
$inttedkala=(int)$tedkala;
$afa="0";
$a=(int)$afa;
for (;$a<$inttedstore;){
$storeusername=$arrusers[$a];
$faktorss=$arrfactor[$a];
$tablename='devlist'.$storeusername;
echo $tablename;
echo $faktorss;
$result = $this->conn->query("SELECT id FROM'".$tablename."' WHERE prcode='".$faktorss."' ");
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$user = array();
$user[$faktorss] = $row["id"];
return $user;
}
}else {
return "no";
}
$a++;
}
and give to me the errors
trying to get property of non-object on line 543 means " if ($result->num_rows > 0) { "
why happen and how fix it ?