void $DB_DataObject->escape (string $value)
void $DB_DataObject->escape
Similar to Pear DB's quote it will escape a value, without the quotes, so it can be used with a LIKE query.
string $value - the string you want to escape
Ez a függvény nem hívható statikusan.
Példa 35-1. Escaping a LIKE string
$person = new DataObjects_Person; $person->whereAdd("name LIKE '%" . $person->escape("o'brian") . "%'"); $person->find();
Példa 35-2. Sample SQL
SELECT * FROM PERSON WHERE name LIKE '%o\'brian%'