Re: more results (loop)
| From: | Sebastian | Date: | Sat, 12 Apr 2003 02:20:10 +0000 |
| Subject: | Re: more results (loop) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143504@lists.php.net to get a copy of this message | ||
it was a typo on my part.. but still returns one row if i use fetch_array..
cheers,
- Sebastian
----- Original Message -----
From: "Mark Douglas" <Mark.Douglas@Q9.com>
| Your problem with the code below is that you're mysql_fetch_row on
$result2
| instead of $result...
|
| -----Original Message-----
| From: Sebastian [mailto:sebastian@dslr.net]
| Sent: Friday, April 11, 2003 10:11 PM
| To: php list
| Subject: [PHP] more results (loop)
|
|
| 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
|
|