Código:
Fatal error: Call to a member function fetch_array() on boolean in
y el codigo donde me señala el error es el siguiente
Código:
Model.php on line 44
Código
<?php class Model { public static function exists($modelname){ $fullpath = self::getFullpath($modelname); $found=false; $found = true; } return $found; } public static function getFullpath($modelname){ return Core::$root."core/app/model/".$modelname.".php"; } public static function many($query,$aclass){ $cnt = 0; while($r = $query->fetch_array()){ $array[$cnt] = new $aclass; $cnt2=1; foreach ($r as $key => $v) { if($cnt2>0 && $cnt2%2==0){ $array[$cnt]->$key = $v; } $cnt2++; } $cnt++; } return $array; } ////////////////////////////////// public static function one($query,$aclass){ $cnt = 0; $found = null; $data = new $aclass; while($r = $query->fetch_array()){ $cnt=1; foreach ($r as $key => $v) { if($cnt>0 && $cnt%2==0){ $data && $key = $v; } $cnt++; } $found = $data; break; } return $found; } }
me pueden ayudar.