function DatabaseHandler::escape_question_marks

7.x DatabaseHandler.php DatabaseHandler::escape_question_marks($str)
6.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 152

Class

DatabaseHandler

Code

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