/ Published in: PHP
Expand |
Embed | Plain Text
//Getting Section ID function getSection($iId) { $database = &JFactory::getDBO(); $sql = "SELECT s.id "; $sql .= "FROM #__sections as s join #__content as c on c.sectionid = s.id "; $sql .= "WHERE c.id = $iId "; $database->setQuery( $sql ); $row=$database->loadResult(); return $row; } $section=getSection(JRequest::getInt( 'id')); //Find the id echo $section; // If statement if ($section == 1) { echo 'Section with Id of 1'; } else { echo 'This section isnt section 1'; }
You need to login to post a comment.
