|
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]
|