Authors old

$alphabet = '';
$sql = "SELECT pv.uid, (
SELECT value
FROM profile_values
WHERE uid = pv.uid
AND fid =1
) AS fname, (
SELECT value
FROM profile_values
WHERE uid = pv.uid
AND fid =2
) AS lname
FROM profile_values AS pv
INNER JOIN node ON node.uid = pv.uid
WHERE pv.uid
IN (
SELECT uid
FROM profile_values
WHERE fid =2
)
GROUP BY pv.uid
ORDER BY lname";

$cellstring = "\n

\n

";
for ($i = 65; $i $letter = chr($i);
$cellstring .= "$letter ";
}

$intcolumn = 0;
$result = db_query($sql);
while ($data = db_fetch_object($result))
{
$strFName =$data->fname;
$strLName =$data->lname;
$authorid = $data->uid;

if ($strLName{0} == $alphabet){
$cellstring .= "\n$strLName, $strFName
";
} else {
$alphabet = $strLName{0};
if ($intcolumn % 3){
$cellstring .= "

";
}else{
$cellstring .= "
";
}
$intcolumn = $intcolumn + 1;
$cellstring .= "\n$alphabet
";
$cellstring .= "\n
$strLName, $strFName
";
}

}
$cellstring .= "

";
echo $cellstring;
?>