开发者

Num Rows always ='s 1 for some reason. QUICK FIX

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜