Herkes hata alıyorum bana söyleyebilir: Önemli hata: Call to a member function fetch_assoc() on a non-object sınıf içinde bu yöntem için
Bu tekrarlanan bir fonksiyon olduğunu ve ben hatası alıyorum ikinci kez, ince ilk kez çalışır.
function getSite($var, $var1 = 0, $numLevel = 1){
//get the page
$qry = "SELECT * FROM table WHERE columnA = $var AND columnB = $var1 ORDER BY parent, position ASC";
$arrPage = $this->my_sqli->query($qry);
//a valid resut was returned from the DB
while($obj = $arrPage->fetch_assoc()){
//add to array
if($obj['id']){
$this->arrMenu = array(
'id' => $obj['id'],
'parent' => $obj['parent'],
'level' => $numLevel
);
... some more code
// call the function again
getSite($value1);
}
}
}