What is the fastest and easiest way to move the fetched data into an array using prepared statements?
Everything I do seems ad-hoc.
... we bind results in two variable $col1 and $col2 ...
$x = 0; $myarray = array();
while(mysqli_stmt_fetch($stmt)){
$myarray[$x]['col1'] = $col1;
$myarray[$x]['col2'] = $col2;
$x++;
}
...
Now we have a multidimensional array $myarray (what I want).
However, if I have more variables seems a little inconvenient to repeat over and over again... I wonder if there is any way faster or better.