Mysqli查询返回自己而不是结果

时间:2016-04-02 15:33:27

标签: php mysql database mysqli

<?php

$top10 = $mysqli->query("SELECT * FROM entries ORDER BY Votes ASC");

if ($top10->num_rows > 0) {
    // output data of each row
    while($row = $top10->fetch_assoc()) {
        echo "<li>" . $row['name'] . " " . "Votes: " . $row['Votes'] . "</li>";
    }
} else {
    echo "0 results";
}
?>

而不是从db返回每一行,这只是从查询开始返回自己(&#34; SELECT ...

0 个答案:

没有答案