Esempio n. 1
0
 public static function get_user_by_email($user_email)
 {
     if ($user_email) {
         $sql = "SELECT `user_id` FROM `users` WHERE `user_email` = " . database_essence::prepare($user_email);
         if ($data = database_essence::get_row($sql)) {
             return new user_object($data);
         }
     }
     return null;
 }
Esempio n. 2
0
 public static function get_comment_by_id($comment_id)
 {
     if (is_numeric($comment_id)) {
         $sql = "SELECT `comment_id` FROM `comments` WHERE `comment_id` = " . database_essence::prepare($comment_id);
         if ($data = database_essence::get_row($sql)) {
             return new comment_object($data);
         }
     }
     return null;
 }
Esempio n. 3
0
 public static function get_file_by_id($file_id)
 {
     if (is_numeric($file_id)) {
         $sql = "SELECT `file_id` FROM `files` WHERE `file_id` = " . database_essence::prepare($file_id);
         if ($data = database_essence::get_row($sql)) {
             return new file_object($data);
         }
     }
     return null;
 }