something like this
PHP Code:
if ($nextone)
{ // set the variables
$nextone = $nextone['articles_articleid'];
$nextarticle = 1;
$articlenav_direction = ">";
$articlenav_order = "ORDER BY articles_articleid ASC";
}
else if ($previousone)
{
$previousone = $previousone['articles_articleid'];
$prearticle = 1;
$articlenav_direction = "<";
$articlenav_order = "ORDER BY articles_articleid DECS";
}
$articlenav = $DB_site->query_first("SELECT articles_articleid FROM " . TABLE_PREFIX . "articles_article WHERE articles_articleid $articlenav_direction $artid AND categoryid = $categoryid $articlenav_order LIMIT 1");
far from impressive really, both acheive the same thing as well, theris really no reason to switch since it don't perform the query unless asked to.