db conn 4





PHPXRef 0.7 : NEABExplorer : /libs/db_conn_4.php source









[ Index ]


PHP Cross Reference of NEABExplorer














if (gwGetCookie('xrefnav')=='off')
document.write('[ Show Explorer ]');
else
document.write('[ Hide Explorer ]');



[ Show Explorer ]
[ Hide Navbar ]





titleBody[close]
/libs/ -> db_conn_4.php (source)

[Summary view]
[Print]
[Text view]


1 <?PHP
2 /**
3 * Emulate ADODB (min) functionalities and at the same time be 2x as fast
4 * Code used for PHP 4.X
5 */
6
7 if(!isset($basedir))
8 {
9 $cur=getcwd();
10 $cur=str_replace("\\","/",$cur);
11 while($cur != "")
12 {
13 if(file_exists("$cur/game.php"))
14 {
15 $basedir=$cur;
16 break;
17 }
18 $cur=substr($cur,0,strrpos($cur,"/"));
19 }
20 }
21
22 include_once "$basedir/config/config.inc";
23
24 Class database
25 {
26 var $conn;
27
28 function database($host,$username,$password,$dbname)
29 {
30 $this->conn = mysql_connect($host, $username, $password)
31 or die("Could not connect : " . mysql_error());
32 mysql_select_db($dbname,$this->conn) or die("Could not select database");
33 }
34
35 function close() { mysql_close($this->conn);}
36
37 function execute($query) { $res=new resultset(); return $res->exec($query,$this->conn); }
38
39 function getid() { return mysql_insert_id(); }
40
41 function SelectLimit($query,$nb,$start) { $res=new resultset(); return $res->exec($query." LIMIT $start,$nb",$this->conn); }
42
43 function updateclob($table,$field,$data,$where) { $query="UPDATE $table SET $field=".$this->qstr($data)." WHERE $where"; return mysql_query($query,$this->conn); }
44
45 function qstr($str)
46 {
47 $res="";
48 for($i=0;$i < strlen($str);$i++)
49 {
50 if(substr($str,$i,1) == "'")
51 $res.="''";
52 else
53 $res.=substr($str,$i,1);
54 }
55 return "'$res'";
56 }
57 }
58
59 class resultset
60 {
61 var $result;
62 var $fields;
63 var $EOF;
64
65 function resultset() {$this->EOF=true;$this->result=null;}
66
67 function exec($query,$conn)
68 {
69 global $userid,$demoengine;
70
71 if($demoengine && isset($userid) && $userid < 3 && strtolower(substr($query,0,1)) != "s")
72 {
73 $p=explode(" ",$query);
74 if($p[1] != "PLAYER")
75 return false;
76 }
77
78 $this->EOF=false;
79 $this->result = mysql_query($query,$conn);
80 if($this->result === FALSE) { $this->result=null;$this->EOF=true; return false; }
81 if($this->result === TRUE) { $this->result=null;$this->EOF=true; return true; }
82 $this->fields=mysql_fetch_row($this->result);
83 if($this->fields === FALSE) { $this->EOF=true; $this->fields=array(); }
84 return $this;
85 }
86
87 function close() { if($this->result != null) @mysql_free_result($this->result); }
88
89 function movenext()
90 {
91 $this->fields=mysql_fetch_row($this->result);
92 if($this->fields === FALSE)
93 {
94 $this->fields=array();
95 $this->EOF=true;
96 }
97 }
98
99 function fieldcount() { return mysql_num_fields($this->result); }
100
101 function fetchfield($col)
102 {
103 return mysql_fetch_field($this->result, $col);
104 }
105 }
106
107
108 $db=new database($dbhost, $dbuser, $dbpass, $dbname);
109 ?>



FUNC_DATA={
'movenext': ['movenext', '', [['libs','db_conn_5.php',89],['libs','db_conn_4.php',89]], 104],
'selectlimit': ['selectlimit', '', [['libs','db_conn_5.php',41],['libs','db_conn_4.php',41]], 3],
'getid': ['getid', '', [['libs','db_conn_5.php',39],['libs','db_conn_4.php',39]], 0],
'exec': ['exec', '', [['libs','db_conn_5.php',67],['libs','db_conn_4.php',67]], 0],
'resultset': ['resultset', '', [['libs','db_conn_5.php',65],['libs','db_conn_4.php',65]], 0],
'qstr': ['qstr', '', [['libs','db_conn_5.php',45],['libs','db_conn_4.php',45]], 122],
'fetchfield': ['fetchfield', '', [['libs','db_conn_5.php',101],['libs','db_conn_4.php',101]], 5],
'close': ['close', '', [['libs','db_conn_5.php',35],['libs','db_conn_5.php',87],['libs','db_conn_4.php',35],['libs','db_conn_4.php',87]], 380],
'updateclob': ['updateclob', '', [['libs','db_conn_5.php',43],['libs','db_conn_4.php',43]], 13],
'fieldcount': ['fieldcount', '', [['libs','db_conn_5.php',99],['libs','db_conn_4.php',99]], 8],
'execute': ['execute', '', [['libs','db_conn_5.php',37],['libs','db_conn_4.php',37]], 652],
'database': ['database', '', [['libs','db_conn_5.php',28],['libs','db_conn_4.php',28]], 2],
'mysql_fetch_row': ['mysql_fetch_row', '', [], 4],
'file_exists': ['file_exists', '', [], 48],
'explode': ['explode', '', [], 44],
'substr': ['substr', '', [], 91],
'mysql_query': ['mysql_query', '', [], 2],
'strtolower': ['strtolower', '', [], 16],
'mysql_connect': ['mysql_connect', '', [], 2],
'mysql_error': ['mysql_error', '', [], 2],
'strrpos': ['strrpos', '', [], 10],
'exec': ['exec', '', [], 0],
'getcwd': ['getcwd', '', [], 4],
'mysql_fetch_field': ['mysql_fetch_field', '', [], 2],
'str_replace': ['str_replace', '', [], 44],
'mysql_select_db': ['mysql_select_db', '', [], 2]};
CLASS_DATA={
'database': ['database', '', [['libs','db_conn_5.php',24],['libs','db_conn_4.php',24]], 2],
'resultset': ['resultset', '', [['libs','db_conn_5.php',59],['libs','db_conn_4.php',59]], 0]};
CONST_DATA={
};

titleDescriptionBody
titleDescriptionBody
titleDescriptionBody
titleBody



Generated: Sun Jul 8 18:11:25 2007
Cross-referenced by PHPXref 0.7





Wyszukiwarka

Podobne podstrony:
db conn 4
db conn 5
db conn
db conn
db conn 5
db conn 5
db conn
db conn 4
db conn
DB
DB AmbershawTOU
DB Movie 03 Mysterious Adventures
db techshare
db poland
db naval tech
db revolt
db event list
db strategic bomber

więcej podobnych podstron