The following code is an increment code in an array.
However, I have not been able to select any value from the array. If I give print_r
to it, it shows all but if I try to access with $guarda_array[1]
it returns Array
and not the name that I want. Is some of the code wrong?
$guarda_array = array();
$count_pub=mysqli_query($db, "SELECT nome FROM publicidades_sponsors");
$count_tudo=mysqli_num_rows($count_pub);
while($gu=mysqli_fetch_assoc($count_pub)){
array_push($guarda_array, $gu);
}
The print_r
shows the following
Array ( [0] => Array ( [nome] => DIDAXIS1.png ) [1] => Array ( [nome] => DIDAXIS2.png ) [2] => Array ( [nome] => DIDAXIS3.png ) [3] => Array ( [nome] => DIDAXIS4.png ) )