Re: MySQL get second row problem
| From: | Petre Agenbag | Date: | Thu, 02 Oct 2003 10:16:46 +0000 |
| Subject: | Re: MySQL get second row problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164717@lists.php.net to get a copy of this message | ||
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