Try this:
PHP Code:
if ($action=="main") {
$result = $DB_site->query("SELECT * FROM links_cat ORDER by catorder");
if (mysql_num_rows($result)) {
while ($row=$DB_site->fetch_array($result)) {
$catid=$row["linkcatid"];
$catname=$row["catname"];
$catbyline=$row["catbyline"];
$result1= $DB_site->query("SELECT * FROM links_content WHERE categoryid='$catid'");
if (mysql_num_rows($result1)) {
while ($row2=$DB_site->fetch_array($result1)) { // changed $row into $row2 because $row is used in the other while
$name=$row2["name"];
$byline=$row2["byline"];
$content=$row2["content"];
eval("\$catlistbit .= \"".gettemplate('links_catbit')."\";"); // edit the template, change $row into $row2
} // end while $row2
} // end if rows $result1
} // end while $row
} // end if rows $result
eval("dooutput(\"".gettemplate('links_main')."\");");
}