select * in a remote DB (mysql) doesn’t bring all the data

the query is simple -> “SELECT * FROM xxx”;

when the result comes, it brings only the last result of the table instead all.

if I’m not mistaken, most remote databases come with a limit on the amount of data that is fetched, in order to avoid overflowing results.
But none of that is for sure, just my speculation.
Anyway, how to solve this?

(im using phpadmin to get acess to the DB)

EDIT: this is my code

 $stmt = mysqli_stmt_init($conn);

$sql = "SELECT * FROM favorite";

mysqli_stmt_prepare($stmt, $sql);

mysqli_stmt_execute($stmt);

$result = mysqli_stmt_get_result($stmt);

$row = mysqli_fetch_assoc($result);

var_dump($row);

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Try

$row = mysqli_fetch_all($result);
mysqli_fetch_assoc();

only returns 1 row which explains why you only see the last row of the expected result set.

mysqli_fetch_all


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x