Posts

Showing posts with the label mysqli_data_seek

Using same query again inside while loop in PHP

 Using same query again inside while loop in PHP  The mysqli_data_seek() function adjusts the result pointer to an arbitrary row in the result-set. <?php     $con = mysqli_connect('127.0.0.1','root','pinturp1','test');     $sql = "Select * from test.keywords limit 20";     $resultQuery = mysqli_query($con,$sql);     while($queryrow = mysqli_fetch_array($resultQuery))     {         echo $queryrow['keyword']."<br>";     }         echo "<br>-------------------------------------------<br>";     mysqli_data_seek($resultQuery, 0);     while($queryrow = mysqli_fetch_array($resultQuery))     {         echo $queryrow['keyword']."<br>";     }         echo "<br>--------------------------...