JDatabase/quote: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Get a quoted database escaped string
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</no... |
m preparing for archive only |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
Get a quoted database escaped string | Get a quoted database escaped string | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 42: | Line 40: | ||
</source> | </source> | ||
<! removed transcluded page call, red link never existed > | |||
< | |||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=quote | category=quote | ||
category=JDatabase | category=JDatabase | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API16]] | |||
Latest revision as of 01:27, 25 March 2017
Description
Get a quoted database escaped string
<! removed transcluded page call, red link never existed >
Syntax
quote($text, $escaped=true)
| Parameter Name | Default Value | Description |
|---|---|---|
| $text | A string | |
| $escaped | true | Default true to escape string, false to leave the string unchanged |
Returns
string
Defined in
libraries/joomla/database/database.php
Importing
jimport( 'joomla.database.database' );
Source Body
public function quote($text, $escaped = true)
{
return '\''.($escaped ? $this->getEscaped($text) : $text).'\'';
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples