forum.coppermine-gallery.net
Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: matiseijas on March 16, 2004, 06:00:40 pm
-
Hello, is there a PHP variable that gives me the name of the album the pic belongs to?
-
I dont know if this already exists, but it's quite a simple function to make:
function which_album($pid)
{
global $CONFIG;
$result = db_query ("SELECT a.title as title FROM {$CONFIG['TABLE_ALBUMS']} as a,{$CONFIG['TABLE_PICTURES']} as p WHERE p.pid = $pid AND a.aid = p.aid");
$row = mysql_fetch_array($result);
return $row['title'];
}
-
Works wonderful! Thanks! ;D