class_BasicMySql.inc.php
2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* @file BasicMySql.inc.php
* @category freeSN
* @mailto code [at] netz.coop
* @version 0.4.200901
* @link http://netz.coop
*
* @copyright Copyright by netz.coop e.G. 2015
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Klasse die die Standard SQL Funktionen umsetzt
*
* @version 0.1.080107
* @author dev [at] mensch [dot] coop
* @abstract
*/
abstract class BasicMySql implements iBasicSql {
protected $User;
protected $Password;
protected $Database;
protected $Host;
protected $connection;
protected $resource;
protected $query;
protected $db_selected;
protected $SRequest;
protected $ThisClassName;
public static $count___construct=0;
public static $MySql_count_query=0;
public static $PDOSRequest_count_query=0;
public static $count_nextRow=0;
public function __toString() {
$var_string='obj('.get_class($this).')';
return $var_string;
}
public function __construct(array $param_DataBaseData, PDO $param_PDO=null){
BasicMySql::$count___construct++;
$this->User = $param_DataBaseData['config_user'];
$this->Password = $param_DataBaseData['config_passwd'];
$this->Database = $param_DataBaseData['config_db'];
$this->Host = $param_DataBaseData['config_dbserver'];
$this->ThisClassName = get_class($this);
if(array_key_exists('SREQUEST', $param_DataBaseData) && is_array($param_DataBaseData['SREQUEST'])) {
$var_PDOObject = new PDO( "mysql:host=".$param_DataBaseData['SREQUEST']['config_dbserver'].";dbname=".$param_DataBaseData['SREQUEST']['config_db']."",
$param_DataBaseData['SREQUEST']['config_user'],
$param_DataBaseData['SREQUEST']['config_passwd']
// , array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true)
);
$this->SRequest = new PDOSRequest($param_DataBaseData['SREQUEST'], $var_PDOObject);
}
}
/**
* Function closes the connection to the MySQL-Server.
* @return bool
*/
public function disconnect(){
}
public function &getObjVar($param_ObjVar) {
$ObjVar = trim($param_ObjVar);
if($this->$ObjVar) {
return $this->$ObjVar;
}
}
}
?>