38 public function ifsql($test, $resok, $resko);
67 public function idate($param, $gm =
'tzserver');
82 public function begin($textinlog =
'');
96 public function DDLCreateDb($database, $charset =
'', $collation =
'', $owner =
'');
169 public function order($sortfield =
'', $sortorder =
'');
257 public function query($query, $usesavepoint = 0, $type =
'auto', $result_mode = 0);
270 public function connect($host, $login, $passwd, $name, $port = 0);
279 public function plimit($limit = 0, $offset = 0);
349 public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys =
null, $fulltext_keys =
null, $keys =
null);
379 public function DDLAddField($table, $field_name, $field_desc, $field_position =
"");
448 $dolibarr_main_db_host,
449 $dolibarr_main_db_user,
450 $dolibarr_main_db_pass,
451 $dolibarr_main_db_name
474 public function jdate($string, $gm =
false);
484 public function encrypt($fieldorvalue, $withQuotes = 1);
500 public function free($resultset =
null);
Class to manage Dolibarr database access for an SQL database.
DDLInfoTable($table)
List information of columns into a table.
error()
Return description of last error.
order($sortfield='', $sortorder='')
Define sort criteria of request.
lasterror()
Return last error label.
select_db($database)
Select a database.
commit($log='')
Validate a database transaction.
DDLCreateUser( $dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name)
Create a user and privileges to connect to database (even if database does not exists yet)
DDLListTables($database, $table='')
List tables into a database.
fetch_array($resultset)
Return data as an array.
decrypt($value)
Decrypt sensitive data in database.
close()
Close database connection.
errno()
Return generic error code of last operation.
lasterrno()
Return last error code.
DDLGetConnectId()
Return connection ID.
rollback($log='')
Canceling a transaction and returning to old values.
encrypt($fieldorvalue, $withQuotes=1)
Encrypt sensitive data in database Warning: This function includes the escape and add the SQL simple ...
DDLDropField($table, $field_name)
Drop a field from table.
lastquery()
Return last request executed with query()
connect($host, $login, $passwd, $name, $port=0)
Connection to server.
query($query, $usesavepoint=0, $type='auto', $result_mode=0)
Execute a SQL request and return the resultset.
ifsql($test, $resok, $resko)
Format a SQL IF.
DDLDescTable($table, $field="")
Return a pointer of line with description of a table or field.
sanitize($stringtosanitize)
Sanitize a string for SQL forging.
DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys=null, $fulltext_keys=null, $keys=null)
Create a table into database.
escapeforlike($stringtoencode)
Escape a string to insert data into a like.
getListOfCollation()
Return list of available collation that can be used for database.
begin($textinlog='')
Start transaction.
DDLAddField($table, $field_name, $field_desc, $field_position="")
Create a new field into table.
DDLDropTable($table)
Drop a table into database.
getDriverInfo()
Return version of database client driver.
getVersion()
Return version of database server.
getServerStatusValues($filter='')
Return value of server status.
affected_rows($resultset)
Return the number of lines in the result of a request INSERT, DELETE or UPDATE.
getVersionArray()
Return version of database server into an array.
getListOfCharacterSet()
Return list of available charset that can be used to store data in database.
lastqueryerror()
Return last query in error.
getPathOfRestore()
Return full path of restore program.
getPathOfDump()
Return full path of dump program.
DDLListTablesFull($database, $table='')
List tables into a database with table type.
getDefaultCollationDatabase()
Return collation used in database.
DDLCreateDb($database, $charset='', $collation='', $owner='')
Create a new database Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated We fo...
stddevpop($nameoffield)
Return SQL string to aggregate using the Standard Deviation of population.
DDLUpdateField($table, $field_name, $field_desc)
Update format of a field into a table.
escape($stringtoencode)
Escape a string to insert data.
convertSQLFromMysql($line, $type='ddl')
Convert a SQL request in Mysql syntax to native syntax.
last_insert_id($tab, $fieldid='rowid')
Get last ID after an insert INSERT.
fetch_row($resultset)
Return data as an array @TODO deprecate this.
fetch_object($resultset)
Returns the current line (as an object) for the resultset cursor.
num_rows($resultset)
Return number of lines for result of a SELECT.
getServerParametersValues($filter='')
Return value of server parameters.
jdate($string, $gm=false)
Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) 19700101020000 -...
idate($param, $gm='tzserver')
Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date fiel...
free($resultset=null)
Free last resultset used.
plimit($limit=0, $offset=0)
Define limits and offset of request.
getDefaultCharacterSetDatabase()
Return charset used to store data in database.