try
<?php while ($row = mysqli_fetch_assoc($result_slider)) {
var_dump($row);
} ?>
You cannot run the result mysqli_querythrough a foreach loop, since it is not an array. What you need to do is process the result using some function mysqli_fetch, in this case mysqli_fetch_assocor mysqli_fetch_array, which returns each row of the query result as an associative array.
source
share