DB::get PHP Method

get() public static method

public static get ( )
    public static function get()
    {
        $args = func_get_args();
        return call_user_func_array(array(DB::getMDB(), 'get'), $args);
    }

Usage Example

Example #1
0
 public static function getYesUsers($eid)
 {
     global $fp;
     $fp->log("eid: {$eid}");
     $db = DB::get()->getConnection();
     $sql = "SELECT user.*, event.quota as quota FROM user_event, user, event WHERE event.eid =:eid AND user.uid = user_event.uid AND user_event.eid =:eid AND answer = 1";
     $stmt = $db->prepare($sql);
     if (!$stmt->execute(array(':eid' => $eid))) {
         $err = "ERROR(UserEvent::getYes): Update on the server failed!->" . join(", ", $stmt->errorInfo());
         error_log($err);
         $fp->log($err);
         return false;
     }
     $out = array();
     $i = 0;
     while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {
         if ($i == 0) {
             $o->quota = $r['quota'];
         }
         $out[$r['uid']] = $r;
         ++$i;
     }
     $o->num = count($out);
     if (!isset($o->quota)) {
         $o->quota = 1000000;
     }
     $o->users = $out;
     return $o;
 }
All Usage Examples Of DB::get