xPDO.quote
Last updated not available | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn morexPDO::quote¶
Quotes a string for use in an SQL statement, escaping it according to the current driver. Prefer prepared statements with bound parameters; use this only when you must build raw SQL.
Syntax¶
string|boolean quote (string $string, [integer $parameter_type = PDO::PARAM_STR])
$string— the value to quote.$parameter_type— the PDO parameter type,PDO::PARAM_STRby default orPDO::PARAM_INTfor integers.
Example¶
$username = $xpdo->quote($username);
$sql = "SELECT * FROM users WHERE username = $username";
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn more










