Jump to content

Getting next in array


iversonm

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.