public static function dbGet($id = NULL) { $dbh = new DBL(); $strSQL = "SELECT * FROM alliance WHERE alliance.alliance_id=" . $id; $result = $dbh->query($strSQL); while ($record = $result->fetch_array()) { $newAlliance = new Alliance(); $newAlliance->setName($record["alliance_name"]); $newAlliance->setCode($record["alliance_code"]); $newAlliance->setDescription($record["alliance_description"]); $buffer[] = $newAlliance; } $result->free(); if (isset($id)) { return $buffer[0]; } return $buffer; }