Changeset 1596 for trunk/gregarius/cls
- Timestamp:
- 10/04/06 12:18:19 (2 years ago)
- Files:
-
- 1 modified
-
trunk/gregarius/cls/db/db.mysql.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gregarius/cls/db/db.mysql.php
r1181 r1596 31 31 class MysqlDB extends DB { 32 32 33 var $resource; 34 33 35 function MysqlDB() { 34 36 parent::DB(); … … 41 43 42 44 function DBConnect($dbserver, $dbuname, $dbpass) { 43 if (!mysql_connect($dbserver, $dbuname, $dbpass)) { 45 $this -> resource = mysql_connect($dbserver, $dbuname, $dbpass); 46 47 if(!$this -> resource) { 44 48 die( "<h1>Error connecting to the database!</h1>\n" 45 49 ."<p>Have you edited dbinit.php and correctly defined " … … 49 53 50 54 function DBSelectDB($dbname) { 51 if (!mysql_select_db($dbname )) {55 if (!mysql_select_db($dbname, $this -> resource)) { 52 56 die( "<h1>Error selecting the database!</h1>\n" 53 57 ."<p>Does your database exist?" … … 60 64 61 65 function rss_query ($query, $dieOnError=true, $preventRecursion=false) { 62 $ret = mysql_query($query );66 $ret = mysql_query($query, $this -> resource); 63 67 64 68 if ($error = $this -> rss_sql_error()) { … … 101 105 102 106 function rss_sql_error() { 103 return mysql_errno( );107 return mysql_errno($this -> resource); 104 108 } 105 109 106 110 function rss_sql_error_message () { 107 return mysql_error( );111 return mysql_error($this -> resource); 108 112 } 109 113 110 114 function rss_insert_id() { 111 return mysql_insert_id( );115 return mysql_insert_id($this -> resource); 112 116 } 113 117 … … 125 129 switch ($kind) { 126 130 case RSS_SQL_ERROR_NO_ERROR: 127 return (mysql_errno( ) == 0);131 return (mysql_errno($this -> resource) == 0); 128 132 break; 129 133 case RSS_SQL_ERROR_DUPLICATE_ROW: 130 return (mysql_errno( ) == 1062);134 return (mysql_errno($this -> resource) == 1062); 131 135 break; 132 136 default:
