I am working on a little project, but unfortunately, my hosting does not support the package mysqldn, therefore I am unable to work with fetch_all()
function. This is the block of code thats causing headaches to me.
public function fetch($type = 'object')
{
if (isset($this->result))
{
switch ($type)
{
case 'array':
//fetch a row as array
//$row = $this->result->fetch_all();
$rows = array();
while($row = $this->result->fetch_assoc())
{
$rows[] = $row;
}
break;
case 'object':
//fall through...
default:
//fetch a row as object
$row = $this->result->fetch_object();
break;
}
return $rows;
}
return FALSE;
}
As I said previously, I can not use fetch_all()
function on my current hosting. Therefore, is there any alternative to that function? what can I do?