Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

joomla query to get sectionid

trying to get something in content.php



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

10+ Year Member

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

$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?


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

WebmasterWorld Senior Member 10+ Year Member

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.


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

10+ Year Member

Got it.

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


Featured Threads

Hot Threads This Week

Hot Threads This Month