/* Decoded by unphp.net */ class Dao { var $userName; var $server; var $password; var $connection; var $dbName; public function Dao($server,$userName,$password,$dbName) { $this->userName = $userName; $this->server = $server; $this->password = $password; $this->dbName = $dbName; $this->dbCoding = "UTF8"; } public function FetchRows($query,$num = 1000) { $obj_array = array(); $i = 0; if (!$query){ echo "Error: ".mysql_error(); }else { while ($row = mysql_fetch_object($query)){ $obj_array[$i] = $row; $i++; if ($i >$num) break; } } return $obj_array; } public function FetchRow($query) { $rows = $this->FetchRows($query); if (sizeof($rows)==0) { return null; } else { return $rows[0]; } } public function GetMessage($query,$message) { if (!$query){ $query_message["error"] = "Error: ".mysql_error(); }else { $query_message["message"] = $message; } return $query_message; } public function Connect() { $connection = mysql_connect($this->server,$this->userName,$this->password,$this->dbName); if (!$connection) die('Could not connect :'.mysql_error()); if (!mysql_query("SET NAMES '$this->dbCoding'")) die('Could not set connection coding :'.mysql_error()); if (!mysql_select_db($this->dbName)) die ('Could not selecet database '.$this->dbName .' : '.mysql_error()); return $connection; } public function Disconnect($connection) { } } ;