Example #1
0
 public static function get_total_comments($file_id = 0)
 {
     $sql = "SELECT COUNT(*) FROM `comments` ";
     if (is_numeric($file_id) && $file_id > 0) {
         $sql .= "WHERE `file_id` = " . database_essence::prepare($file_id);
     }
     if ($data = database_essence::get_one($sql)) {
         return $data;
     }
     return null;
 }
Example #2
0
 public static function get_user_password($user_id)
 {
     if (is_numeric($user_id)) {
         $sql = "SELECT `user_password` FROM `users` WHERE `user_id` = " . database_essence::prepare($user_id);
         if ($data = database_essence::get_one($sql)) {
             return $data;
         }
     }
     return null;
 }