RE: [PHP] MySQL get second row problem [Solved]
| From: | Joe Harman | Date: | Thu, 02 Oct 2003 10:20:42 +0000 |
| Subject: | RE: [PHP] MySQL get second row problem [Solved] | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164718@lists.php.net to get a copy of this message | ||
Hey Thanks Petre
Cheers... And a big brain fart
> -----Original Message-----
> From: Petre Agenbag [mailto:internet@vsa.co.za]
> Sent: Thursday, October 02, 2003 6:17 AM
> To: Joe Harman
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] MySQL get second row problem
>
>
> Either limit your query to return only the second row ( look
> in mysql manual for the limit caluse), or you will need to
> move the array counter forward one for the $row_rsLastL =
> mysql_fetch_assoc($rsLastL) operation.(php manual under array
> functions)
>
>
> On Thu, 2003-10-02 at 12:10, Joe Harman wrote:
> > Hello... I am having just alittle trouble with this... I know it's
> > simple... Look at my comment for the problem I am having
> >
> > <?php
> > mysql_select_db($database_ideation, $ideation);
> > $query_rsLastL = "SELECT * FROM logins WHERE user_id =
> '$UserID'
> > ORDER BY
date DESC";
> > $rsLastL = mysql_query($query_rsLastL, $ideation) or
> > die(mysql_error());
> > $row_rsLastL = mysql_fetch_assoc($rsLastL);
> > $totalRows_rsLastL = mysql_num_rows($rsLastL);
> >
> > // Prints the first row... I just want to print just the second row
> > echo $row_rsLastL['date'];
> >
> > mysql_free_result($rsLastL);
> > ?>
> >
> > Thanks
>
>
>