No, it doesn’t comply to MVC standards but yes it’s still handy:
$db = JFactory::getDBO();
$db->setQuery( ‘Your SQL query here‘ );
$res = $db->loadObject();
Use $res for further operations
IE:
$db = JFactory::getDBO();
$db->setQuery( ‘SELECT c_category FROM #__sample_category WHERE c_id =’ . $k );
$res = $db->loadObject();
$category_name = $res->c_category ;
echo ‘<h2>’.$category_name.'</h2>’;