How can I use mysqli_fetch_array() twice?

前端 未结 4 1005
予麋鹿
予麋鹿 2020-12-01 17:55

I am using the entries of a db to fill a row and a column in a table. But I cannot access the SQL returned data twice using mysqli_fetch_array() twice. This doe

4条回答
  •  孤城傲影
    2020-12-01 18:10

    $squery = mysqli_query($con,"SELECT * FROM table");
    
    while($s = mysqli_fetch_array($query)){
     ....
    }
    // add this line
    mysqli_data_seek( $query, 0 );
    
    while($r = mysqli_fetch_array($query)){
     ...
    }
    

    try it.....

提交回复
热议问题