* @version 2.0.0 * @package UElearning * @subpackage Database */ class DBInfo extends Database { public function queryAllPlaceInfo() { $sqlString = "SELECT * FROM `".$this->table('PlaceInfo')."` WHERE 1"; $query = $this->connDB->prepare($sqlString); $query->execute(); $queryResultAll = $query->fetchAll(); // return $queryResultAll; // 如果有查到一筆以上 if( count($queryResultAll) >= 1 ) { // 製作回傳結果陣列 $result = array(); foreach($queryResultAll as $key => $thisResult) { array_push($result, array( 'id' => $thisResult['IID'], 'name' => $thisResult['IName'], 'content' => $thisResult['IContent'] )); } return $result; } // 若都沒查到的話 else { return null; } } public function queryALLPlaceMap() { $sqlString = "SELECT * FROM `".$this->table('PlaceMap')."` WHERE 1"; $query = $this->connDB->prepare($sqlString); $query->execute(); $queryResultAll = $query->fetchAll(); // 如果有查到一筆以上 if( count($queryResultAll) >= 1 ) { // 製作回傳結果陣列 $result = array(); foreach($queryResultAll as $key => $thisResult) { array_push($result, array( 'id' => $thisResult['PID'], 'name' => $thisResult['PName'], 'url' => $thisResult['PURL'] )); } return $result; } // 若都沒查到的話 else { return null; } } }