$dbresult->FetchRow() WTF

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
brownrl
Forum Members
Forum Members
Posts: 74
Joined: Thu Sep 23, 2004 11:06 am

$dbresult->FetchRow() WTF

Post 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
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

$dbresult->FetchRow() WTF

Post by Ted »

page_alias is a varchar It needs to be wrapped in single quotes.
brownrl
Forum Members
Forum Members
Posts: 74
Joined: Thu Sep 23, 2004 11:06 am

DOH DOH DOH DOH DOH!

Post by brownrl »

DOH
Post Reply

Return to “Developers Discussion”