PHP Code:
if ($_REQUEST['do'] == 'mypage')
{
$id = $vbulletin->input->clean_gpc('r', 'id', TYPE_UINT);
$mypage = $vbulletin->db->query_first("
SELECT *
FROM " . TABLE_PREFIX ."mypage
WHERE id = $id
");
eval('$mytemp = "' . fetch_template('mytemp') . '";');
}
$navbits = array();
$navbits[$parent] = 'My page';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('mypage_home') . '");');
You don't need a loop, you're only using query_first(), which will return the first result as an array.