MySQL result to point to the beginning

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I have an unbuffered query mysql-result as follows:

$result = mysql_unbuffered_query($sqlstring, $db_connection);

Now, I am accessing the result:

while ($row = mysql_fetch_row($result))

How can I put the pointer of the result back to the start? I tried it with


but this does not work. Who can help?



Re: MySQL result to point to the beginning

Quoted text here. Click to load it

I suspect that the reason why mysql_data_seek($result,0) doesn't work
may have something to do with the fact that the manual specifically
says it does not work with mysql_unbuffered_query().

Indeed, if you bother to think about it for just a moment, you will
realise that, since the result is not buffered, there is no "start" to
go back to!

Or did you think that unbuffered meant something else?

The only way to restart it is to re-issue the query.

Site Timeline