homepage Welcome to WebmasterWorld Guest from 23.20.19.131
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
joomla query to get sectionid
trying to get something in content.php
David_M




msg:3410155
 5:06 am on Aug 1, 2007 (gmt 0)

I'm trying to get the sectionid when the file content.php runs (com_content) in joomla 1.0x.

$uid=$id;
$query = "SELECT *"
. "\n FROM #__content"
. "\n WHERE id = " . (int) $uid
;
$database->setQuery( $query );
$row = NULL;
$row = $database->loadObjectList();
$mysectionid =$row->sectionid;

Any ideas why its not giving me the sectionid?

 

Habtom




msg:3410169
 6:04 am on Aug 1, 2007 (gmt 0)

Try echoing your query echo $query; and see if you have got the query right. Perhaps that will give you a hint if there is a problem with the query.

David_M




msg:3411076
 1:06 am on Aug 2, 2007 (gmt 0)

Got it.

$query = 'SELECT sectionid FROM #__content WHERE id = ' . $id;
$database->setQuery( $query );
$mysectionid = $database->loadResult();

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved