I have a small problem with my mysqli related function. Here is the code:
$query = "SELECT * FROM uploads";
if ($result = $mysqli->query($query)) {
while ($row = $result->fetch_assoc()) {
return $row;
}
The problem is that when I use this function $row
appears to be an array, but with only the first value from the query result in it.
But if I try to return var_dump($row)
instead, function displays array as expected, with all the values from the query result.
Can you please explain why is this happening and how to return an array with complete query result correctly.
Thanks!
Change this:
For:
Call test function
The function is only for make more readable