call last row

call last row

am 27.01.2007 02:10:17 von badmets

hi, i'm a newbie to php and sql and am trying to execute the following
script: i want to call the latest entry to a field in a record set.
its a letter, that asks for a signature, and i want to display, on a
diffent page, the latest signature. here's the letter:
http://badmets.com/buckner/

struggling.....

Re: call last row

am 27.01.2007 02:45:15 von no

On 26 Jan 2007 17:10:17 -0800, "badmets@gmail.com"
wrote:

>hi, i'm a newbie to php and sql and am trying to execute the following
>script: i want to call the latest entry to a field in a record set.
>its a letter, that asks for a signature, and i want to display, on a
>diffent page, the latest signature. here's the letter:
>http://badmets.com/buckner/
>
>struggling.....
OK, split the idea into 2 stages ...

* you want 1 record only, so you'll use a clause like "LIMIT 1" in
your SELECT

* you want the last record first - so select the ORDER BY and use DESC
So, like

SELECT * FROM signatures ORDER BY idsignatures DESC LIMIT 1

Hope that helps
Chris R.

Re: call last row

am 27.01.2007 10:24:00 von Paul Lautman

badmets@gmail.com wrote:
> hi, i'm a newbie to php and sql and am trying to execute the
> following script: i want to call the latest entry to a field in a
> record set. its a letter, that asks for a signature, and i want to
> display, on a diffent page, the latest signature. here's the letter:
> http://badmets.com/buckner/
>
> struggling.....

Search comp.databases.mysql for the phrase "strawberry query". It'll tell
you how to do exactly what you want. My lates post on it includes a full
explanation of how it works.