This question has already been answered:
- Getting count of lines through COUNT 1 answer
$result = mysqli_query($link, "SELECT first_name FROM example1");
How can echo output the result using echo?
This question has already been answered:
$result = mysqli_query($link, "SELECT first_name FROM example1");
How can echo output the result using echo?
The mysqli_query () function returns an object of type mysqli_result, or false. With echo you can't get it out. The easiest way to display it for debug:
$result = mysqli_query($link, "SELECT first_name FROM example1"); if ($result) { $arr = mysqli_fetch_all($result, MYSQLI_ASSOC); echo "<pre>"; print_r($arr); echo "</pre>"; }
The mysqli_fetch_all () function extracts all the data from the result and puts it into an array. The array type is specified by the second parameter.
Source: https://ru.stackoverflow.com/questions/969566/
All Articles