100 public function getAccountsAllData($data = array()) {
101 $sql = "SELECT COUNT(*) AS count FROM `accounts`";
102 if(!empty($data)) {
103 $count = count($data);
104 $sql .= " WHERE";
105 foreach($data as $key => $value) {
106 $sql .= " $key = '" . $this->db->escape($value) . "'";
107
108 $count--;
109 if($count > 0) $sql .= " AND";
110 }
111 }
112 $query = $this->db->query($sql);
113 $d = $query->row['count'];
114 return $d;
115 }