Hey folks,
I am trying to create a pair of previous/next links.
I find a value from a database and then want my links to be the previous and next records.
I have determined that all my values are in the array but I am having trouble accessing them.
Testing, I can loop through the array OK using
However I would have thought that I would have hte same result from
but it only returns the first record.
I am a bit brain dead and am likely not seeing the obvious here...but I just can't see how to achieve what I know is relatively straight forward.
The way I would really like to do this is use array_search to find the key for the value of the record I have and then find prev and next (allowing for beginning and end of array etc)
Maybe I just need a break...but any pointers appreciated.
Steve
- I have fun with telemarketers
I am trying to create a pair of previous/next links.
I find a value from a database and then want my links to be the previous and next records.
I have determined that all my values are in the array but I am having trouble accessing them.
Testing, I can loop through the array OK using
Code:
do{
echo $row_categories["categoryID"] . " ";
}while($row_categories = mysql_fetch_assoc($categories));
However I would have thought that I would have hte same result from
Code:
foreach ($row_categories as $a ){
echo $a . "<br>";
}
I am a bit brain dead and am likely not seeing the obvious here...but I just can't see how to achieve what I know is relatively straight forward.
The way I would really like to do this is use array_search to find the key for the value of the record I have and then find prev and next (allowing for beginning and end of array etc)
Maybe I just need a break...but any pointers appreciated.
Steve
- I have fun with telemarketers