Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISPConfig
ISPConfig 3
Commits
a123dfe7
Commit
a123dfe7
authored
Dec 06, 2008
by
tbrehm
Browse files
Updated mysql database library to support replication.
parent
a78dfc66
Changes
1
Show whitespace changes
Inline
Side-by-side
server/lib/classes/db_mysql.inc.php
View file @
a123dfe7
<?php
/*
Copyright (c) 200
7
, Till Brehm, projektfarm Gmbh
Copyright (c) 200
5
, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
...
...
@@ -28,13 +27,12 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
class
db
{
class
db
{
var
$dbHost
=
""
;
// hostname of the MySQL server
var
$dbName
=
""
;
// logical database name on that server
var
$dbUser
=
""
;
// database authorized user
var
$dbPass
=
""
;
// user's password
var
$dbCharset
=
""
;
// what charset comes and goes to mysql: utf8 / latin1
var
$linkId
=
0
;
// last result of mysql_connect()
var
$queryId
=
0
;
// last result of mysql_query()
var
$record
=
array
();
// last record fetched
...
...
@@ -42,7 +40,7 @@ class db
var
$currentRow
;
// current row number
var
$errorNumber
=
0
;
// last error number
var
$errorMessage
=
""
;
// last error message
var
$errorLocation
=
""
;
// last error location
var
$errorLocation
=
""
;
// last error location
var
$show_error_messages
=
false
;
// constructor
...
...
@@ -54,7 +52,6 @@ class db
$this
->
dbName
=
$conf
[
"db_database"
];
$this
->
dbUser
=
$conf
[
"db_user"
];
$this
->
dbPass
=
$conf
[
"db_password"
];
$this
->
dbCharset
=
$conf
[
"db_charset"
];
//$this->connect();
}
...
...
@@ -81,7 +78,6 @@ class db
$this
->
updateError
(
'DB::connect()<br />mysql_connect'
);
return
false
;
}
$this
->
queryId
=
@
mysql_query
(
'SET NAMES '
.
$this
->
dbCharset
,
$this
->
linkId
);
}
return
true
;
}
...
...
@@ -227,13 +223,23 @@ class db
}
}
function
closeConn
()
{
public
function
closeConn
()
{
if
(
$this
->
linkId
)
{
mysql_close
(
$this
->
linkId
);
return
true
;
}
else
{
return
false
;
}
}
function
freeResult
()
{
public
function
freeResult
(
$query
)
{
if
(
mysql_free_result
(
$query
))
{
return
true
;
}
else
{
return
false
;
}
}
function
delete
()
{
...
...
@@ -484,6 +490,6 @@ class db
}
}
}
}
?>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment