function _DatabaseHandler::escape_question_marks

4.x _DatabaseHandler.php _DatabaseHandler::escape_question_marks($str)
5.x _DatabaseHandler.php _DatabaseHandler::escape_question_marks($str)

This is a simple helper function which "escapes" the question marks (?) in the string, by changing them to "??". This makes it suitable for use within db_query(), but not necessary if used as an argument. Ex: db_query("INSERT ... '" . $db->escape_question_marks($xml) . "' "); is good. db_query("INSERT ... '?' ", $xml); is good. This function not needed.

Parameters

unknown_type $str:

File

classes/_DatabaseHandler.php, line 237

Class

_DatabaseHandler

Code

function escape_question_marks($str) {
  $rtn = str_replace("?", "??", $str);
  return $rtn;
}