protect_identifiers($item[, $prefix_single = FALSE[, $protect_identifiers = NULL[, $field_exists = TRUE]]])
Parameters: |
|
---|---|
Returns: |
The modified item |
Return type: |
string |
Takes a column or table name (optionally with an alias) and applies the configured dbprefix to it.
Some logic is necessary in order to deal with column names that include the path.
Consider a query like this:
SELECT * FROM hostname.database.table.column AS c FROM hostname.database.table
Or a query with aliasing:
SELECT m.member_id, m.member_name FROM members AS m
Since the column name can include up to four segments (host, DB, table, column) or also have an alias prefix, we need to do a bit of work to figure this out and insert the table prefix (if it exists) in the proper position, and escape only the correct identifiers.
This method is used extensively by the Query Builder class.
Please login to continue.