mysqli_fetch_row 它是如何工作的? [英] mysqli_fetch_row How does it work?

查看:43
本文介绍了mysqli_fetch_row 它是如何工作的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个功能是如何工作的?例如这个循环:

How does this function work? for exaple this loop:

while ($rows=mysqli_fetch_row) { 
    do this and that...
}

所以基本上问题是:每次你调用这个函数时,它都会返回下一行,直到没有剩下的行,所以如果你再次调用它,条件变为 FALSE 对吗?因此,如果您在此循环之后再次在外部调用此函数,它将返回哪一行?谢谢.

so basically the question is: Everytime you call this function,it returns the next rows until none it's left, so if you call it again the condition becomes FALSE right? SO if you call this function again outside after this loop which row is it going to return? Thanks.

推荐答案

如果您想知道这是如何工作的,该函数会维护一个内部数据指针,用于跟踪它所在的记录(只是一个带有数字的变量),每次调用它都会将指针加一,为了自己设置指针,您需要使用已经概述的 mysqli_data_seek() 函数.

If you were wondering how this works, the function maintains an internal data pointer which keeps track of the record it is on (just a variable with a number), every time it is called it will increment the pointer by one, in order to set the pointer yourself, you'd want to use the mysqli_data_seek() function as already outlined.

这篇关于mysqli_fetch_row 它是如何工作的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆