Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
bd577cc3
Commit
bd577cc3
authored
Mar 31, 2008
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Logs
parent
469fb590
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/lib/databases/mysql.lib.php
+54
-50
54 additions, 50 deletions
htdocs/lib/databases/mysql.lib.php
with
54 additions
and
50 deletions
htdocs/lib/databases/mysql.lib.php
+
54
−
50
View file @
bd577cc3
...
@@ -229,7 +229,7 @@ class DoliDb
...
@@ -229,7 +229,7 @@ class DoliDb
*/
*/
function
connect
(
$host
,
$login
,
$passwd
,
$name
,
$port
=
0
)
function
connect
(
$host
,
$login
,
$passwd
,
$name
,
$port
=
0
)
{
{
dolibarr_syslog
(
"DoliDB::connect host=
$host
, port=
$port
, login=
$login
, passwd=--hidden--, name=
$name
"
);
dolibarr_syslog
(
"DoliDB::connect host=
$host
, port=
$port
, login=
$login
, passwd=--hidden--, name=
$name
"
,
LOG_DEBUG
);
// With mysql, port must be in hostname
// With mysql, port must be in hostname
$newhost
=
$host
;
$newhost
=
$host
;
...
@@ -789,7 +789,7 @@ class DoliDb
...
@@ -789,7 +789,7 @@ class DoliDb
$sql
.
=
","
.
implode
(
','
,
$sqlk
);
$sql
.
=
","
.
implode
(
','
,
$sqlk
);
$sql
.
=
") type="
.
$type
;
$sql
.
=
") type="
.
$type
;
dolibarr_syslog
(
$sql
);
dolibarr_syslog
(
$sql
,
LOG_DEBUG
);
if
(
!
$this
->
query
(
$sql
))
if
(
!
$this
->
query
(
$sql
))
return
-
1
;
return
-
1
;
else
else
...
@@ -806,7 +806,7 @@ class DoliDb
...
@@ -806,7 +806,7 @@ class DoliDb
{
{
$sql
=
"DESC "
.
$table
.
" "
.
$field
;
$sql
=
"DESC "
.
$table
.
" "
.
$field
;
dolibarr_syslog
(
$sql
);
dolibarr_syslog
(
$sql
,
LOG_DEBUG
);
$this
->
results
=
$this
->
query
(
$sql
);
$this
->
results
=
$this
->
query
(
$sql
);
return
$this
->
results
;
return
$this
->
results
;
}
}
...
@@ -840,6 +840,7 @@ class DoliDb
...
@@ -840,6 +840,7 @@ class DoliDb
$sql
.
=
" "
.
$field_desc
[
'extra'
];
$sql
.
=
" "
.
$field_desc
[
'extra'
];
$sql
.
=
" "
.
$field_position
;
$sql
.
=
" "
.
$field_position
;
dolibarr_syslog
(
$sql
,
LOG_DEBUG
);
if
(
!
$this
->
query
(
$sql
))
if
(
!
$this
->
query
(
$sql
))
return
-
1
;
return
-
1
;
else
else
...
@@ -872,7 +873,7 @@ class DoliDb
...
@@ -872,7 +873,7 @@ class DoliDb
$sql
.
=
" VALUES ('
$dolibarr_main_db_host
','
$dolibarr_main_db_name
','
$dolibarr_main_db_user
'"
;
$sql
.
=
" VALUES ('
$dolibarr_main_db_host
','
$dolibarr_main_db_name
','
$dolibarr_main_db_user
'"
;
$sql
.
=
",'Y','Y','Y','Y','Y','Y','Y','Y');"
;
$sql
.
=
",'Y','Y','Y','Y','Y','Y','Y','Y');"
;
dolibarr_syslog
(
"mysql.lib::DDLCreateUser sql="
.
$sql
);
dolibarr_syslog
(
"mysql.lib::DDLCreateUser sql="
.
$sql
,
LOG_DEBUG
);
$resql
=
$this
->
query
(
$sql
);
$resql
=
$this
->
query
(
$sql
);
if
(
!
$resql
)
if
(
!
$resql
)
{
{
...
@@ -881,7 +882,7 @@ class DoliDb
...
@@ -881,7 +882,7 @@ class DoliDb
$sql
=
"FLUSH Privileges"
;
$sql
=
"FLUSH Privileges"
;
dolibarr_syslog
(
"mysql.lib::DDLCreateUser sql="
.
$sql
);
dolibarr_syslog
(
"mysql.lib::DDLCreateUser sql="
.
$sql
,
LOG_DEBUG
);
$resql
=
$this
->
query
(
$sql
);
$resql
=
$this
->
query
(
$sql
);
return
1
;
return
1
;
...
@@ -891,7 +892,8 @@ class DoliDb
...
@@ -891,7 +892,8 @@ class DoliDb
* \brief Return charset used to store data in database
* \brief Return charset used to store data in database
* \return string Charset
* \return string Charset
*/
*/
function
getDefaultCharacterSetDatabase
(){
function
getDefaultCharacterSetDatabase
()
{
$resql
=
$this
->
query
(
'SHOW VARIABLES LIKE \'character_set_database\''
);
$resql
=
$this
->
query
(
'SHOW VARIABLES LIKE \'character_set_database\''
);
if
(
!
$resql
)
if
(
!
$resql
)
{
{
...
@@ -902,7 +904,8 @@ class DoliDb
...
@@ -902,7 +904,8 @@ class DoliDb
return
$liste
[
'Value'
];
return
$liste
[
'Value'
];
}
}
function
getListOfCharacterSet
(){
function
getListOfCharacterSet
()
{
$resql
=
$this
->
query
(
'SHOW CHARSET'
);
$resql
=
$this
->
query
(
'SHOW CHARSET'
);
$liste
=
array
();
$liste
=
array
();
if
(
$resql
)
if
(
$resql
)
...
@@ -926,7 +929,8 @@ class DoliDb
...
@@ -926,7 +929,8 @@ class DoliDb
* \brief Return collation used in database
* \brief Return collation used in database
* \return string Collation value
* \return string Collation value
*/
*/
function
getDefaultCollationDatabase
(){
function
getDefaultCollationDatabase
()
{
$resql
=
$this
->
query
(
'SHOW VARIABLES LIKE \'collation_database\''
);
$resql
=
$this
->
query
(
'SHOW VARIABLES LIKE \'collation_database\''
);
if
(
!
$resql
)
if
(
!
$resql
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment