API17:JDatabase::nameQuote
From Joomla! Documentation
(Difference between revisions)
(Layout updates) |
(Updated to r1448:247ba8d88526) |
||
| Line 2: | Line 2: | ||
=={{JVer|11.1}} JDatabase::nameQuote== | =={{JVer|11.1}} JDatabase::nameQuote== | ||
===Description=== | ===Description=== | ||
| − | + | Wrap an SQL statement identifier name such as field, table or database names in quotes to prevent injection risks and reserved word conflicts. | |
{{Description:JDatabase::nameQuote}} | {{Description:JDatabase::nameQuote}} | ||
| Line 8: | Line 8: | ||
<nowiki>[</nowiki>[[Description:JDatabase::nameQuote|Edit Descripton]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[Description:JDatabase::nameQuote|Edit Descripton]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
| − | |||
| − | |||
| − | |||
<source lang="php"> | <source lang="php"> | ||
| − | public | + | public function nameQuote ($name) |
</source> | </source> | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 21: | Line 18: | ||
!Description | !Description | ||
|- | |- | ||
| − | |$ | + | |$name |
|string | |string | ||
| | | | ||
| − | |The identifier to | + | |The identifier name to wrap in quotes. |
|- | |- | ||
|} | |} | ||
| − | + | * '''Returns''' string The quote wrapped name. | |
| − | string The | + | * '''Defined''' on line 877 of libraries/joomla/database/database.php |
| − | + | * '''Since''' {{JVer|11.1 }} | |
| − | libraries/joomla/database/database.php | + | |
| − | * | + | |
| − | + | ||
===See also=== | ===See also=== | ||
| + | * {{JVer|11.1}} '''JDatabase::nameQuote source code''' on [[jplatform:database/database.php#cl-869|BitBucket]] | ||
| + | * {{JVer|11.1}} Class [[JDatabase/11.1|JDatabase]] | ||
| + | * {{JVer|11.1}} Subpackage [[Subpackage_Database/11.1|Database]] | ||
| + | * [[JDatabase::nameQuote|Other versions of JDatabase::nameQuote]] | ||
| + | {{SeeAlso:JDatabase::nameQuote}} | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[</nowiki>[[SeeAlso:JDatabase::nameQuote|Edit See Also]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[SeeAlso:JDatabase::nameQuote|Edit See Also]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
| − | + | ===User contributed notes=== | |
| − | + | ||
| − | + | ||
| − | === | + | |
<CodeExamplesForm /> | <CodeExamplesForm /> | ||
<dpl> | <dpl> | ||
| Line 48: | Line 44: | ||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
| + | namespace=CodeExample | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
<noinclude>[[Category:JDatabase]][[Category:JDatabase::nameQuote]]</noinclude> | <noinclude>[[Category:JDatabase]][[Category:JDatabase::nameQuote]]</noinclude> | ||
Revision as of 20:26, 27 April 2011
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
JDatabase::nameQuote
Description
Wrap an SQL statement identifier name such as field, table or database names in quotes to prevent injection risks and reserved word conflicts.
Description:JDatabase::nameQuote [Edit Descripton]
public function nameQuote ($name)
| Parameter | Type | Default | Description |
|---|---|---|---|
| $name | string | The identifier name to wrap in quotes. |
- Returns string The quote wrapped name.
- Defined on line 877 of libraries/joomla/database/database.php
- Since
See also
-
JDatabase::nameQuote source code on BitBucket
-
Class JDatabase
-
Subpackage Database
- Other versions of JDatabase::nameQuote
SeeAlso:JDatabase::nameQuote [Edit See Also]
User contributed notes
<CodeExamplesForm />
