db_host = $const_db_host; $this->db_name = $const_db_name; $this->db_user = $const_db_user; $this->db_pass = $const_db_pass; $this->charSet = $const_db_charset; $this->errorMsg = false; $this->fDBconn = false; $this->lastQuery = false; } // kapcsolodik az adatbazishoz //// visszateres: true/false function connectDB($host = false, $dbname = false, $user = false, $pass = false) { $this->errorMsg = false; if ($host) $this->db_host = $host; if ($dbname) $this->db_name = $dbname; if ($user) $this->db_user = $user; if ($pass) $this->db_pass = $pass; $this->fDBconn = @mysql_connect($this->db_host, $this->db_user, $this->psws($this->db_pass)); echo $this->errorMsg = mysql_error(); if (!$this->errorMsg) { // if ($this->charSet) mysql_query("SET NAMES '".$this->charSet."'", $this->fDBconn); mysql_query("SET NAMES 'utf8'" ,$this->fDBconn); return true; } else { //require(INC_DIR.'frontend/off.inc'); echo "connection failed;"; exit; return false; } } // bontja a kapcsolatot az adatbazissal //// visszateres: -- function disconnectDB() { if ($this->fDBconn) { mysql_close($this->fDBconn); } } // a $query-ben atadott mySQL utasitast hajtja vegre. //// visszateres: - sikeres futas: a lekerdezes eredmenye egy tombben, egyeb esetben true //// - sikertelen: false function qExec($query) { global $conf; if($conf['mysql_query_log'] == 1)print_mysql_log($query, 'log_'.date("Y-m-d").'_mysql_query.log'); // nullazzuk a hibauzenetet $this->errorMsg = false; // eltaroljuk a kerest $this->lastQuery = $query; // ha nincs aktiv kapcsolat, letrehozzuk if (!$this->fDBconn) { if (!$this->connectDB()) { return false; } } // ha ide eljutottunk, akkor biztos van kapcsolat $res = @mysql_db_query($this->db_name, $query); if (!$res) { // hiba $this->errorMsg = mysql_error(); if($conf['mysql_error_log'] == 1)print_mysql_log($this->errorMsg.' - '.$query.' - '.$_SERVER['REQUEST_URI'], 'log_'.date("Y-m-d").'_mysql_error.log'); return false; } else { // sikeres futas // eltaroljuk a insert ID-t is $this->ins_id = mysql_insert_id(); if (strtolower(substr($query,0,4)) == "sele" || strtolower(substr($query,0,4)) == "show") { // select volt, egy tombben visszaadjuk az eredmenyt $resArray = array(); $i = 0; while ($rec = mysql_fetch_array($res)) { $resArray[$i] = $rec; $i++; } return $resArray; } else { // insert utasitas volt return true; } } } function beginTr() { return $this->qExec("start transaction"); } function commitTr() { return $this->qExec("commit"); } function psws($t){ if($t!='')return substr($t,2,-1); else return $t; } function rollbackTr() { return $this->qExec("rollback"); } } ?>
Fatal error: Uncaught Error: Class 'fDB' not found in /home/sapipeti/domains/thaimassagebudapest.com/public_html/inc/db.php:7 Stack trace: #0 /home/sapipeti/domains/thaimassagebudapest.com/public_html/inc/db.php(17): dbconn('sapipeti_hal') #1 /home/sapipeti/domains/thaimassagebudapest.com/public_html/config.php(56): require_once('/home/sapipeti/...') #2 /home/sapipeti/domains/thaimassagebudapest.com/public_html/index.php(6): require_once('/home/sapipeti/...') #3 {main} thrown in /home/sapipeti/domains/thaimassagebudapest.com/public_html/inc/db.php on line 7