Öffentliche Methoden | |
| connect ($conf) | |
| disconnect () | |
| query ($query) | |
| fetchRow ($result, $rownum) | |
| freeResult ($result) | |
| numCols ($result) | |
| numRows ($result) | |
Öffentliche Attribute | |
| $connection | |
| $error | |
Definiert in Zeile 28 der Datei mysql.class.php.
| DB_mysql::connect | ( | $ | conf | ) |
Definiert in Zeile 45 der Datei mysql.class.php.
00046 { 00047 $host = $conf['host']; 00048 $user = $conf['user']; 00049 $pw = $conf['password']; 00050 $db = $conf['database']; 00051 00052 if ( isset($conf['port']) ) 00053 $host .= ':'.$conf['port']; 00054 00055 if ( $conf['persistent'] ) 00056 $connect_function = 'mysql_pconnect'; 00057 else 00058 $connect_function = 'mysql_connect'; 00059 00060 if ( $pw != '' ) 00061 $this->connection = @$connect_function( $host,$user,$pw ); 00062 elseif ( $user != '' ) 00063 $this->connection = @$connect_function( $host,$user ); 00064 elseif ( $host != '' ) 00065 $this->connection = @$connect_function( $host ); 00066 else 00067 $this->connection = @$connect_function(); 00068 00069 if ( !is_resource($this->connection) ) 00070 { 00071 $this->error = "Could not connect to database on host $host."; 00072 return false; 00073 } 00074 00075 if ( $db != '' ) 00076 { 00077 if ( !@mysql_select_db( $db,$this->connection ) ) 00078 { 00079 $this->error = "Could not select database '$db' on host $host."; 00080 return false; 00081 } 00082 } 00083 00084 return true; 00085 }
| DB_mysql::disconnect | ( | ) |
Definiert in Zeile 89 der Datei mysql.class.php.
00090 { 00091 $ret = mysql_close( $this->connection ); 00092 $this->connection = null; 00093 return $ret; 00094 }
| DB_mysql::fetchRow | ( | $ | result, | |
| $ | rownum | |||
| ) |
| DB_mysql::freeResult | ( | $ | result | ) |
Definiert in Zeile 118 der Datei mysql.class.php.
00119 { 00120 if ( is_resource($result) ) 00121 return mysql_free_result($result); 00122 return true; 00123 }
| DB_mysql::numCols | ( | $ | result | ) |
| DB_mysql::numRows | ( | $ | result | ) |
| DB_mysql::query | ( | $ | query | ) |
Definiert in Zeile 98 der Datei mysql.class.php.
00099 { 00100 $result = mysql_query($query, $this->connection); 00101 00102 if ( ! $result ) 00103 { 00104 $this->error = 'Database error: '.mysql_error(); 00105 return FALSE; 00106 } 00107 00108 return $result; 00109 }
| DB_mysql::$connection |
Definiert in Zeile 35 der Datei mysql.class.php.
| DB_mysql::$error |
Definiert in Zeile 42 der Datei mysql.class.php.
1.5.8