title: Unable to call php function and unable to show results
body: <p>There are three files
  1). classes/header_featured.php</p>
  
  <pre><code>&lt;?php
      class header_featured{
          function getfeatured() {
              global $db;
              $ads = array();
              $featured_ads = mysql_query("SELECT * FROM class_ads where active=1 and featured=1 limit 50"); 
              while ($temp = mysql_fetch_assoc($featured_ads)) { 
                  $record = array();
                  $record['ad_id']      = $temp['id'];
                  $record['ad_title']   = $temp['title'];
  
                  //check for image if featured ad have image (Need to fetch only single image)
                  $featured_ads_images = mysql_query("select * from class_ads_pictures where ad_id={$record['ad_id']} order by order_no"); 
                  $img = mysql_fetch_assoc($featured_ads_images);
                  $record['img_id']         = $img['id'];
                  $record['ad_img']         = $img['picture'];
                 $record['img_folder']     = $img['folder'];
  
                  $ads[] = $record;
              } 
          }
      }
  ?&gt;
  </code></pre>
  
  <p>2). h_featured.php</p>
  
  <pre><code>&lt;?php
  
  require_once "include/include.php";
  require_once "classes/header_featured.php";
  global $db;
  $smarty = new Smarty;
  $smarty = common($smarty);
  
  $obj = new header_featured();
  $featured_ads = $obj-&gt;getfeatured();
  $smarty-&gt;assign('featured_ads ', $featured_ads );
  
  $db-&gt;close();
  if($db-&gt;error!='') { $db_error = $db-&gt;getError(); $smarty-&gt;assign('db_error',$db_error); }
  
  $smarty-&gt;display('h_featured.html');
  close();
  ?&gt;
  </code></pre>
  
  <p>3). templates/h_featured.html</p>
  
  <pre><code> {foreach item=item  from=$no_featured} 
    {$item.ad_id}
    {$item.ad_title}
    {$item.img_id}
    {$item.ad_img}
    {$item.img_folder}
   {/foreach}
  </code></pre>
  
  <p>What i want basically, I want to show featured ads in my website header so for this i created a file "classes/header_featured.php" in which i am fetchings rows from database and then i created another file in root "h_featured.php" in which i am calling the function of feature ads and assign variables to smarty file "templates/h_featured.html" but it not working for me it look like no display or no calling of function or no assign of data ...</p>
  
  <p>Please help ..</p>