Q:

how to treat special characters as regular characters pdo

Im a having a problem with this piece of code, im using a form to pass a value to a search engine, what I want to do is to read special character as regular character, becuase if i type %sam% it reads this as part of the 'query', not like a  regular string(normal character)
it is possible to 
$search = $_GET['query']; 
$query = "SELECT * FROM mobiles WHERE (`name` LIKE :search) or (`type` LIKE :search)"; 
$query_params = array(':search' => mysql_real_escape_string( $search ));

try
{
  $stmt = $db->prepare($query);
  $result = $stmt->execute($query_params);
}
catch(PDOException $ex)
{
  die("Failed to run query: " . $ex->getMessage());
}

A:

use quote from your pdo Connection Object
 $db->quote($search ); //Assuming your connection is $db

Though % is special in that, it is legal in a string, so you would probably have to escape it manually.
$search = str_replace("%", "\%", $search), 

