I want to create a function that returns all results from a mysqli query in an array.
function Get(){
// verification... verification...
$res = $this -> link -> query("SELECT " . $select . " FROM " . $from);
while ($res->fetch_assoc())
{
$row[] = $res->fetch_assoc();
}
return $row;
}
i = 0;
var_dump(Get());
the while returns only the 1,3,5,7,9 results
Can someone explain the result?