You are here

public function FrxMSSQL::format in Forena Reports 6.2

Same name and namespace in other branches
  1. 6 plugins/FrxMSSQL.inc \FrxMSSQL::format()
  2. 7 plugins/FrxMSSQL.inc \FrxMSSQL::format()
  3. 7.2 plugins/FrxMSSQL.inc \FrxMSSQL::format()
  4. 7.3 plugins/FrxMSSQL.inc \FrxMSSQL::format()
  5. 7.4 plugins/FrxMSSQL.inc \FrxMSSQL::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/FrxMSSQL.inc, line 144
Oracle specific driver that takes advantage of oracles native XML support

Class

FrxMSSQL
@file Oracle specific driver that takes advantage of oracles native XML support

Code

public function format($value, $key, $data) {
  if ($value === '' || $value === NULL) {
    $value = 'NULL';
  }
  else {
    $value = "'" . str_replace("'", "''", $value) . "'";
  }
  return $value;
}