Go to the source code of this file.
Namespaces | |
| namespace | KERNEL |
Functions | |
| claro_sql_get_tbl ($tableList, $contextData=null) | |
| claro_sql_get_main_tbl () | |
| claro_sql_get_course_tbl ($dbNameGlued=null) | |
| claro_sql_query ($sqlQuery, $dbHandler= '#') | |
| claro_sql_errno ($dbHandler= '#') | |
| claro_sql_error ($dbHandler= '#') | |
| claro_sql_select_db ($dbName, $dbHandler= '#') | |
| claro_sql_affected_rows ($dbHandler= '#') | |
| claro_sql_insert_id ($dbHandler= '#') | |
| claro_sql_field_names ($sql, $resultPt=null) | |
| claro_sql_query_fetch_all_rows ($sqlQuery, $dbHandler= '#') | |
| claro_sql_query_fetch_all ($sqlQuery, $dbHandler= '#') | |
| claro_sql_query_fetch_all_cols ($sqlQuery, $dbHandler= '#') | |
| claro_sql_query_fetch_single_value ($sqlQuery, $dbHandler= '#') | |
| claro_sql_query_get_single_value ($sqlQuery, $dbHandler= '#') | |
| claro_sql_query_fetch_single_row ($sqlQuery, $dbHandler= '#') | |
| claro_sql_query_get_single_row ($sqlQuery, $dbHandler= '#') | |
| claro_sql_query_affected_rows ($sqlQuery, $dbHandler= '#') | |
| claro_sql_query_insert_id ($sqlQuery, $dbHandler= '#') | |
| claro_sql_escape ($statement, $db=null) | |
| get_context_db_discriminator ($toolId) | |
| claro_sql_affected_rows | ( | $ | dbHandler = '#' |
) |
CLAROLINE mySQL affected rows wrapper.
Definition at line 397 of file sql.lib.php.
| claro_sql_errno | ( | $ | dbHandler = '#' |
) |
CLAROLINE mySQL errno wrapper.
Definition at line 346 of file sql.lib.php.
| claro_sql_error | ( | $ | dbHandler = '#' |
) |
CLAROLINE mySQL error wrapper.
Definition at line 363 of file sql.lib.php.
| claro_sql_escape | ( | $ | statement, | |
| $ | db = null | |||
| ) |
Protect Sql statment
| unknown_type | $statement | |
| unknown_type | $db |
Definition at line 755 of file sql.lib.php.
| claro_sql_field_names | ( | $ | sql, | |
| $ | resultPt = null | |||
| ) |
Get the name of the specified fields in a query result
| string | $sq - SQL query | |
| ressource | (optional) - result pointer |
Definition at line 437 of file sql.lib.php.
| claro_sql_get_course_tbl | ( | $ | dbNameGlued = null |
) |
| string | $dbNameGlued (optionnal) course database with its platform glue already append. If no db name are set, the current course db will be taken. |
Definition at line 200 of file sql.lib.php.
| claro_sql_get_main_tbl | ( | ) |
Get list of table names for central table.
Definition at line 146 of file sql.lib.php.
| claro_sql_get_tbl | ( | $ | tableList, | |
| $ | contextData = null | |||
| ) |
Return the tablename for a tool, dependig on the execution context WARNING DO NOT USE THIS FUNCTION UNTIL THE deprecated TAG IS REMOVE
| array | $tableList | |
| array | $contextData id To discrim table. Do not add context Id of an context active but managed by tool. |
If it's in a course, $courseId is set or $courseId is null but not claro_get_current_course_id() if both are null, it's a main table
when
Tool Context capatibility
There is many context in claroline, a new tool can don't provide initially all field to discrim each context in fields. When a tool can't discrim a context, the table would be duplicated for each instance and the name of table (or db) contain the discriminator
This extreme modularity provide an easy growing and integration but easy
Easy can't mean slowly. If I prupose a blog tool wich can't discrim user I need to duplicate all blog table (in same or separate db).
Read this to understand chanche since previous version thant 1.8
Until 1.8 there was 2 functions
function claro_sql_get_main_tbl() function claro_sql_get_course_tbl($dbNameGlued = null)
both was using conf values claro_sql_get_main_tbl was using conf values * get_conf('mainDbName') * get_conf('mainTblPrefix')
Definition at line 35 of file sql.lib.php.
| claro_sql_insert_id | ( | $ | dbHandler = '#' |
) |
CLAROLINE mySQL insert id wrapper.
Definition at line 414 of file sql.lib.php.
| claro_sql_query | ( | $ | sqlQuery, | |
| $ | dbHandler = '#' | |||
| ) |
CLAROLINE mySQL query wrapper. It also provides a debug display which works when the CLARO_DEBUG_MODE constant flag is set to on (true)
| string | $sqlQuery - the sql query | |
| handler | $dbHandler - optional |
Definition at line 289 of file sql.lib.php.
| claro_sql_query_affected_rows | ( | $ | sqlQuery, | |
| $ | dbHandler = '#' | |||
| ) |
CLAROLINE SQL query wrapper returning the number of rows affected by the query
| string | $sqlQuery the sql query | |
| handler | $dbHandler optional |
Definition at line 691 of file sql.lib.php.
| claro_sql_query_fetch_all | ( | $ | sqlQuery, | |
| $ | dbHandler = '#' | |||
| ) |
Alias for claro_sql_query_fetch_all_rows
Definition at line 521 of file sql.lib.php.
| claro_sql_query_fetch_all_cols | ( | $ | sqlQuery, | |
| $ | dbHandler = '#' | |||
| ) |
CLAROLINE SQL query and fetch array wrapper. It returns all the result in associative array ARRANGED BY COLUMNS.
| string | $sqlQuery the sql query | |
| handler | $dbHandler optional |
Definition at line 539 of file sql.lib.php.
| claro_sql_query_fetch_all_rows | ( | $ | sqlQuery, | |
| $ | dbHandler = '#' | |||
| ) |
CLAROLINE SQL query and fetch array wrapper. It returns all the result rows in an associative array.
| string | $sqlQuery the sql query | |
| handler | $dbHandler optional |
Definition at line 482 of file sql.lib.php.
| claro_sql_query_fetch_single_row | ( | $ | sqlQuery, | |
| $ | dbHandler = '#' | |||
| ) |
CLAROLINE SQL query wrapper returning only the first row of the result Useful in some cases because, it avoid nested arrays of results.
| string | $sqlQuery the sql query | |
| handler | $dbHandler optional |
Definition at line 647 of file sql.lib.php.
| claro_sql_query_fetch_single_value | ( | $ | sqlQuery, | |
| $ | dbHandler = '#' | |||
| ) |
CLAROLINE SQL query wrapper returning only a single result value. Useful in some cases because, it avoid nested arrays of results.
| string | $sqlQuery the sql query | |
| handler | $dbHandler optional |
Definition at line 590 of file sql.lib.php.
| claro_sql_query_get_single_row | ( | $ | sqlQuery, | |
| $ | dbHandler = '#' | |||
| ) |
Get a single row from a SQL query
| string | $sqlQuery | |
| ressource | $dbHandler |
Definition at line 660 of file sql.lib.php.
| claro_sql_query_get_single_value | ( | $ | sqlQuery, | |
| $ | dbHandler = '#' | |||
| ) |
CLAROLINE SQL query wrapper returning only a single result value. Useful in some cases because, it avoid nested arrays of results.
| string | $sqlQuery the sql query | |
| handler | $dbHandler optional |
Definition at line 630 of file sql.lib.php.
| claro_sql_query_insert_id | ( | $ | sqlQuery, | |
| $ | dbHandler = '#' | |||
| ) |
CLAROLINE mySQL query wrapper returning the last id generated by the last inserted row
| string | $sqlQuery the sql query | |
| handler | $dbHandler optional |
Definition at line 731 of file sql.lib.php.
| claro_sql_select_db | ( | $ | dbName, | |
| $ | dbHandler = '#' | |||
| ) |
CLAROLINE mySQL selectDb wrapper.
Definition at line 380 of file sql.lib.php.
| get_context_db_discriminator | ( | $ | toolId | ) |
Return an array of 2 array containing context wich can't be manage by tool and where to store the discriminator.
By default it's in table name except of course context wich follow singleDbMode value.
DO NOT USE THIS FUNCTION !
| string | $toolId claro_label |
Definition at line 780 of file sql.lib.php.
1.6.3