Maksim Ivanov Maksim Ivanov - 7 months ago 32
MySQL Question

mysqli - how to fetch a row without altering the result set?

Is it possible to extract a value from mysqli_result without fetching a row i.e. without altering the result set as I need it in full later in my code?


You can also point the iterator back to the beginning. ie..

$result = $mysqli->query($query);
while($row = $result->fetch_assoc())
    //do stuff with the result
//back to the start

now the pointer is returned to the beginning. mysqli_data_seek