Source for file db.structured.php
Documentation is available at db.structured.php
* Structured database access
* GloryLands, a Web-Based, Massive Multiplayer Online RPG/Strategy Game
* Copyright (C) 2008-09 John Haralampidis <jïhnys2[at]gmail.cïm>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* For any help/suggestions or troubleshooting you can see the
* project community website at <http://www.glorylands.gr>
* @license GNU/GPLv3 GNU General Public License version 3
* @author John Haralampidis <jïhnys2[at]gmail.cïm>
* @copyright Copyright (C) 2007-2008, John Haralampidis
* Structured database record
* This class provides record-level structured database access.
private function update_index() {
foreach ($this->_parent->_index as $i) {
public function __get($var) {
if (isset ($this->_data[$var])) {
return $this->_data[$var];
public function __set($var, $value) {
if (isset ($this->_data[$var])) {
$this->_data[$var] = $value;
* Structured database recordset
* This class provides recordset-level structured database access.
$this->_index = array('index');
public function select($index_data= false, $order_by= false, $sort_order= false) {
$this->_recordset = GL::$db->select($this->_table, $index_data, false, $order_by, $sort_order);
if ($this->rows() == 0) return false;
$row = GL::$db->fetch_array(MYSQL_ASSOC, $this->_recordset);
public function first() {
if ($this->rows() == 0) return false;
$row = GL::$db->fetch_array(MYSQL_ASSOC, $this->_recordset);
$row = GL::$db->fetch_array(MYSQL_ASSOC, $this->_recordset);
if ($this->_cursor == 0) return false;
$row = GL::$db->fetch_array(MYSQL_ASSOC, $this->_recordset);
|