JDatabaseQuery::quoteName
Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection risks and reserved word conflicts.
This method is provided for use where the query object is passed to a function for modification. If you have direct access to the database object, it is recommended you use the quoteName method directly. Note that 'qn' is an alias for this method as it is in JDatabaseDriver. Usage: $query->quoteName('#__a'); $query->qn('#__a');
Signature
public function quoteName(mixed
$name,
[mixed
$as = null] )
Parameters
-
$name
- The identifier name to wrap in quotes, or an array of identifier names to wrap in quotes.
-
$as
- The AS query part associated to $name. It can be string or array, in latter case it has to be
Returns
- mixed
- The quote wrapped name, same type of $name.
Errors/Exceptions
-
RuntimeException
- if the internal db property is not a valid object.