Page 1 of 1

function wont echo

Posted: Wed Jul 23, 2003 1:16 pm
by justravis
GRRRR...cant figure y function wont echo.

No errors r give. It just wont echo.

The query works in phpmyadmin.

Any help would be greatly appreciated.

The Function:

<?php

#Outputs Author names & links to popups.
function author_list($artid, $artpg='')
{
$result = mysql_query("SELECT author.id, author.first, author.mid, author.last, author.cre
d FROM author, art_auth WHERE author.org_id='$org_id' AND art_auth.artid=$artid AND art_auth.authi
d=author.id ORDER BY art_auth.rank");

while($author = mysql_fetch_array($result))
{
$authid = $author[id];
$first = $author[first];
$mid = $author[mid];
$last = $author[last];
$cred = $author[cred];

$name = $first;

if($mid)
{
$name .= " $mid";
}

$name .= " $last, $cred";

$authors .="<a href=\"#\" onClick='authWindow($artid, $authid)'><b>$name</b></a>";

if(!$artpg)
{
if($commas<mysql_num_rows($result)-1)
{
$authors .= ', ';

$commas++;
}
else
{
$authors .= "<br>\n";
}
}
else
{
$authors .= "<br>\n";
}
}

if(!$artpg)
{
echo $authors;
}

return $authors;
}

?>

The call:

<?php

author_list($artid);

?>

Posted: Wed Jul 23, 2003 1:25 pm
by qartis
<?
echo author_list($artid);
?>