iversonm Posted November 16, 2009 Share Posted November 16, 2009 public function Get_Photo_Key($UID, $PID, $AID){ $Photos=$this->Get_Photos($UID, $AID); $Current=reset($Photos); foreach($Photos as $Value){ if($Value[0]==$PID){ return array('Next'=>next($Current), 'Previous'=>prev($Current)); } $Current=next($Photos); } } And just so you know what the Get_Photos function is public function Get_Photos($UID, $AID){ global $Database; $Result=$Database->Get_Photos($UID, $AID); while ($Array[] = mysql_fetch_row ($Result)); return $Array; } $aid=album id $pid=picture id $uid=user id i want it to return the next id in order when calling the first function any ideas? Link to comment https://forums.phpfreaks.com/topic/181706-getting-next-in-array/ Share on other sites More sharing options...
iversonm Posted November 16, 2009 Author Share Posted November 16, 2009 I am still trying different methods but non have returned anything successful. I would appreciate some help or advice. Link to comment https://forums.phpfreaks.com/topic/181706-getting-next-in-array/#findComment-958652 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.