Re: more results (loop)
| From: | Florin Dumitrescu | Date: | Fri, 11 Apr 2003 14:09:04 +0000 |
| Subject: | Re: more results (loop) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143502@lists.php.net to get a copy of this message | ||
For retrieving multiple rows you should use mysql_fetch_array().
Still I don't know how you'll print all those rows using the outer
'echo'.
HTH,
Florin.
On Fri, 11 Apr 2003 22:10:58 -0400
"Sebastian" <sebastian@dslr.net> wrote:
> I've seem to have forgotten how to do a loop.
> how do i get more results when the echo is not in the while loop?
> only getting 1 now...
>
> $result = @mysql_query("SELECT * FROM news ORDER BY id DESC LIMIT 3");
> while($row = mysql_fetch_row($result2)) {
> $title = $row[2];
> $text = $row[3];
> }
>
> // other queries....
>
> echo "$title <br/> $text";
>
>
> cheers,
> - Sebastian
>
>
>