I have a problem with the implementation of a dynamic 2 dimensional array. This is the way I am doing this:
$array_ = array();
$values = array();
foreach ($queryresult as $row){
array_push($value, $row['id'];
array_push($value, $row['title'];
array_push($array_, $value);
}
var_dump(#array_);
The problem is that my query returns 3 rows, but my result is as follows:-
Array ([0] => Array ([0] => 44 [1] => Game of Thrones))
Anyone have any idea what I am doing wrong?
$array_ = new Array();that's not valid PHP syntax. Remove "new", arrays are not objects.