I might be searching incorrectly but I cannot find a solution to my issue. I have an empty array created for values in a database. Each row should push a value to the array but after the first element my array becomes an integer.
if ($num_rows > 0){
$dates = [];
while($row = $result->fetch_assoc()){
var_dump($dates);
$dates = array_push($dates, $row['date']);
}
}
Warning: array_push() expects parameter 1 to be array, integer given
EDIT the date field of my db is a varchar
array_pushReturns the new number of elements in the array. (from manual)