public function FrxPDO::format in Forena Reports 7
Same name and namespace in other branches
- 6.2 plugins/FrxPDO.inc \FrxPDO::format()
- 6 plugins/FrxPDO.inc \FrxPDO::format()
- 7.2 plugins/FrxPDO.inc \FrxPDO::format()
- 7.3 plugins/FrxPDO.inc \FrxPDO::format()
- 7.4 plugins/FrxPDO.inc \FrxPDO::format()
Implement custom SQL formatter to make sure that strings are properly escaped. Ideally we'd replace this with something that handles prepared statements, but it wouldn't work for
Parameters
unknown_type $value:
unknown_type $key:
unknown_type $data:
File
- plugins/
FrxPDO.inc, line 123 - General database engine used to do sql queries.
Class
- FrxPDO
- @file General database engine used to do sql queries.
Code
public function format($value, $key, $data) {
$db = $this->db;
if ($db) {
if ($value == '') {
$value = 'NULL';
}
else {
$value = $db
->quote($value);
}
}
return $value;
}