Reply to Re: Return next/previous record from array with non-consecutive record id's

Your name:

Reply:


Posted by ClickToWalk on 10/11/07 11:53

"-Lost" <spam_ninjaREMOVEME@REMOVEMEcomcast.net> wrote in message
news:ZZOdnb6a56HslFzZnZ2dnUVZ_tidnZ2d@comcast.com...
> "ClickToWalk" wrote in message
> news:44bfb933$1_4@mk-nntp-2.news.uk.tiscali.com...
>
>> This is a bit of code that I have used to successfully echo all the
>> available records - with gaps where records are missing - but what
>> modifications do I need to make to it so that only one row is returned
>> from the recordset, determined by $id.
>
> You could throw an if clause in checking the number of rows returned
> (mysql_num_rows) or even possibly check with mysql_affected_rows (assuming
> an INSERT, DELETE, or UPDATE).
>
> You could also LIMIT your results and output those three rows [previous,
> current, next].
>
> Lastly, your query function could do the same as the above, but then also
> check to see if they are valid results. This you could add to your
> existing code...
>
> -Lost

Thanks for getting back Lost, looks like LIMIT may be what I'm looking for,
I'll get back when I've had a play.

Regards
Matt

[Back to original 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

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