Page 1 of 1

$dbresult->FetchRow() WTF

Posted: Mon Nov 01, 2004 1:56 pm
by brownrl
Why does this function crap out? Its a function that I made and put into the lib/content.functions.php file:

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();


}
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

$dbresult->FetchRow() WTF

Posted: Mon Nov 01, 2004 2:05 pm
by Ted
page_alias is a varchar It needs to be wrapped in single quotes.

DOH DOH DOH DOH DOH!

Posted: Mon Nov 01, 2004 2:13 pm
by brownrl
DOH