mysqli ignoring the first row in a table

前端 未结 4 1656
长发绾君心
长发绾君心 2021-01-25 18:14

Here is the code I\'m using to pull the data from the table:

require_once \'connect.php\';
$sql = "SELECT * FROM `db-news`";
$result = $mysqli->query         


        
4条回答
  •  情书的邮戳
    2021-01-25 19:02

    mysqli not ignoring it but actually you are fetching first row before while loop
    
    // $row = mysqli_fetch_assoc($result); //remove this line
     while ($row = $result->fetch_assoc()) {
       ....
     }
    

提交回复
热议问题