If you're using PHPLIB, then using database abstraction the code would look
like:

while ($db->next_record()) {
        print $db->f("title");
}




-----Original Message-----
From: CJD [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 14 August 2001 7:56 AM
To: [EMAIL PROTECTED]
Subject: Re: How do you step through a database?


while ($item=mysql_fetch_array($result)) {
    print $item[title];
}

The loop will continue until the result reaches the end then stops.  Also
works for $result with no results in it (skips the loop) and you can use

mysql_data_seek($result,0);

to reset the counter to the top ready for the next loop



"Jeff Howard" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I've used Visual Basic for years and have never had a problem with this
> issue.  I can use the following code to do this:
>
> do until (rs.eof)
> ..
> rs.movenext
> loop
>
> Does anybody know how to step through a database in PHP?
>
>
>
>




-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to