You are here: Re: call last row « PHP SQL « IT news, forums, messages
Re: call last row

Posted by no on 01/27/07 01:45

On 26 Jan 2007 17:10:17 -0800, "badmets@gmail.com" <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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация