<? 

   // get_categories, called in index.php

   function get_categories() {

     $conn = db_connect(); 

     $query = "select catid, catname from dgerman_php_categories"; 
     $result = @mysql_query($query); 
     if (! $result) 
       return false;
 
     $num_cats = @mysql_num_rows($result); 
     if ($num_cats == 0) 
       return false; 

     $result = db_result_to_array($result); 
     return $result;

   }
 ?>