Re: [PHP] finding next and previous db entries

2002-09-05 Thread Gurhan Ozen
You have to use recursive functions for this. You can write one.. function linkchecker($id) { $query="SELECT COUNT(*) AS mycount FROM tablename WHERE id=".$id.""; $result=mysql_query($query); $row=mysql_fetch_array($result); $nextid = $id + 1; if (($row["mycount"]) > 0 )

Re: [PHP] finding next and previous db entries

2002-09-05 Thread Petre Agenbag
I think it would probably be better to read all the id's into an array, and then use the array stepping functions to move forward or back. This way, you won't have to worry about "empty" rows, or id's that are not numerically following on each other. On Thu, 2002-09-05 at 23:20, tux wrote: > > h