$dbresult->FetchRow() WTF
Posted: Mon Nov 01, 2004 1:56 pm
Why does this function crap out? Its a function that I made and put into the lib/content.functions.php file:
Note that this function's purpose is probably already coded somehwere. However since CMS made simple is not documented I have to to assume that I need to write this myself. Please advise if you know...
I just would like a function to return back an associative array for the current page that the user is viewing. I need to get at the hierarchy information so that a real menu / navigation can be built.
Thank you very much in advance.
Rob
Code: Select all
function current_page_info( )
{
global $gCms;
$db = $gCms->db;
$q = "SELECT * FROM ".cms_db_prefix()."pages WHERE page_alias = ".$_GET['page'];
$dbr = $db->Execute( $q );
return $dbr->FetchRow();
}
I just would like a function to return back an associative array for the current page that the user is viewing. I need to get at the hierarchy information so that a real menu / navigation can be built.
Thank you very much in advance.
Rob