I have a array and i use two foreach but I be only able to print the first foreach.
$test = $db->query("SELECT * FROM Test");
foreach ($test as $readTest) {
echo $readTest["col1"];
}
foreach ($test as $readTest) {
echo $readTest["col2"];
}
and I try with this:
$test1 = $test;
$test2 = $test;
I expect the output of $readTest["col1"]
and $readTest["col2"]
, but the actual output is $readTest["col1"]