conn = DatabaseConnectionFactory::getConnection(); $this->conn->SetFetchMode(ADODB_FETCH_ASSOC); //$this->conn->debug = true; } function getList() { $sql = 'SELECT clubId,name FROM m_club WHERE isValid = 1'; $pstmt = $this->conn->prepare($sql); $rs = $this->conn->Execute($pstmt); if ($rs->EOF) { return null; } return $rs->getArray(); } function findByActive ($limit, $page = 1) { $offset = $limit * ($page - 1); $sql = 'SELECT clubId,name,address,information,accessInformation ' . 'FROM m_club ' . 'WHERE isValid = 1 ' . 'ORDER BY updated DESC ' . 'LIMIT ? OFFSET ?'; //$this->conn->debug = true; $pstmt = $this->conn->prepare($sql); $rs = $this->conn->Execute($pstmt, array($limit, $offset)); if ($rs->EOF) { return null; } return $rs->getArray(); } function findByClubId (&$dto) { $sql = <<conn->prepare($sql); $rs = $this->conn->Execute($pstmt, array($dto->clubId)); $row = $rs->FetchRow(); $dto->clubId = $row['clubId']; $dto->name = $row['name']; $dto->information = $row['information']; $dto->address = $row['address']; $dto->accessInformation = $row['accessInformation']; $dto->memberId = $row['memberId']; $dto->isValid = $row['isValid']; } function findByMemberId (&$dto) { $sql = <<conn->prepare($sql); $rs = $this->conn->Execute($pstmt, array($dto->memberId)); $row = $rs->FetchRow(); $dto->clubId = $row['clubId']; $dto->name = $row['name']; $dto->information = $row['information']; $dto->address = $row['address']; $dto->accessInformation = $row['accessInformation']; $dto->memberId = $row['memberId']; $dto->isValid = $row['isValid']; } function isExsist ($name) { $sql = <<conn->prepare($sql); $rs = $this->conn->Execute($pstmt, array($name)); $row = $rs->FetchRow(); return $row['count'] ? true : false; } function insert(&$dto) { $sql = <<name, $dto->information, $dto->address, $dto->accessInformation, $dto->memberId, $dto->isValid, $dto->creator, $dto->updater ); //$this->conn->debug = true; $pstmt = $this->conn->prepare($sql); if ($this->conn->Execute($pstmt, array($data))) { $sql2 = 'select LAST_INSERT_ID() AS clubId'; $rs2 = $this->conn->Execute($sql2); $row = $rs2->FetchRow(); return $row['clubId']; } return; } function update(&$dto) { $sql = <<clubId, $dto->name, $dto->information, $dto->address, $dto->accessInformation, $dto->memberId, $dto->isValid, $dto->creator, $dto->updater, $dto->clubId ); $pstmt = $this->conn->prepare($sql); $this->conn->Execute($pstmt, $data); } function delete($clubId, $updater) { $sql = <<conn->prepare($sql); $this->conn->Execute($pstmt, $data); } } ?> メンタルテクノファージ DJ・イベント・クラブ情報サイト
メンタルテクノファージ

club