(No version information available, might only be in Git)
Session::quoteName — Add quotes
A quoting function to escape SQL names and identifiers. It escapes the identifier given in accordance to the settings of the current connection. This escape function should not be used to escape values.
name
The string to quote.
The quoted string.
Example #1 mysql_xdevapi\Session::quoteName() example
<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");
$first = "MySQL's test";
var_dump($first);
var_dump($session->quoteName($first));
$second = 'Another `test` "like" `this`';
var_dump($second);
var_dump($session->quoteName($second));
?>
The above example will output something similar to:
string(12) "MySQL's test" string(14) "`MySQL's test`" string(28) "Another `test` "like" `this`" string(34) "`Another ``test`` "like" ``this```"
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant