quoteValue() public method

Note that if the parameter is not a string, it will be returned without change.
See also: http://www.php.net/manual/en/function.PDO-quote.php
public quoteValue ( string $value ) : string
$value string string to be quoted
return string the properly quoted string
Esempio n. 1
0
 /**
  * @deprecated this is broken by design, should use parameters instead
  * @param string $str
  * @return string
  */
 public function escapeSimple($str)
 {
     $str = $this->connection->quoteValue($str);
     if ($str[0] == "'") {
         return substr($str, 1, -1);
     }
     return $str;
 }
Esempio n. 2
0
 /**
  * @deprecated this is broken by design, should use parameters instead
  * @param string $str
  * @return string
  */
 public function escapeSimple($str)
 {
     // doesn't do arrays
     if (!is_scalar($str)) {
         return null;
     }
     $str = $this->connection->quoteValue($str);
     if ($str[0] == "'") {
         return substr($str, 1, -1);
     }
     return $str;
 }