I don't know if i am doing it right, this is what I got:
while($row = mysqli_fetch_assoc($result)) {
$items = mysqli_num_rows($row);
}
It always sets $it开发者_如何学Goems = to 1 for some reason.
Here is my mysqli_query...
$top10_query = "SELECT * FROM users WHERE userid='$userid'";
$result = mysqli_query($cxn, $top10_query) or die("Couldn't execute query.");
$row = mysqli_fetch_assoc($result);
Well, $row
only contains one row so....
$items = mysqli_num_rows($result)
should give you the correct number of items
Anyway, why are you doing that in a loop? The number of rows is constant...
精彩评论