Actions

API17

Difference between revisions of "JDatabase::nameQuote"

From Joomla! Documentation

(Layout updates)
(Updated to r1448:247ba8d88526)
Line 2: Line 2:
 
=={{JVer|11.1}} JDatabase::nameQuote==
 
=={{JVer|11.1}} JDatabase::nameQuote==
 
===Description===
 
===Description===
Quote an identifier name (field, table, etc).  
+
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>
===Since===
 
{{JVer|11.1 }}
 
===Synopsis===
 
 
<source lang="php">
 
<source lang="php">
public JDatabase::nameQuote ($s)
+
public function nameQuote ($name)
 
</source>
 
</source>
 
{| class="wikitable"
 
{| class="wikitable"
Line 21: Line 18:
 
!Description
 
!Description
 
|-
 
|-
|$s
+
|$name
 
|string
 
|string
 
|
 
|
|The identifier to quote.
+
|The identifier name to wrap in quotes.
 
|-
 
|-
 
|}
 
|}
===Returns===
+
* '''Returns''' string The quote wrapped name.
string The quoted identifier.
+
* '''Defined''' on line 877 of libraries/joomla/database/database.php
===Defined in===
+
* '''Since''' {{JVer|11.1 }}
libraries/joomla/database/database.php (line 449)
+
* see source code in [[jplatform:database/database.php#cl-449|BitBucket]]
+
===Referenced by===
+
 
===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>
* [[JDatabase/11.1|JDatabase]]
+
===User contributed notes===
* [[JDatabase::nameQuote|Other versions of this method]]
+
{{SeeAlso:JDatabase::nameQuote}}
+
===Examples===
+
 
<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 19:26, 27 April 2011

Replacement filing cabinet.png
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.

Joomla 11.1 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 Joomla 11.1

See also

SeeAlso:JDatabase::nameQuote [Edit See Also]

User contributed notes

<CodeExamplesForm />