SQL. , .
$sql = "SELECT * FROM MyTable WHERE id = " . $_GET["id"];
$stmt = $pdo->prepare($sql);
? SQL-. . , , .
SQL-, , execute() , . placeholder SQL - . . SQL Injection Myths and Fallacies SQL-.
PDO try. . , try. - , .
set_exception_handler() catch. , , , script, . , PHP try , , catch.
set_exception_handler(). script , , . , . , , - . , PHP .
:
mysql_real_escape_string() , . SQL-.
, , ( ). , escaping/quoting, SQL-. , .
, ( ):
$domainObject = new MyDomain();
try {
$domainObject->create_report($formInput);
} catch (PDOException $e) {
}
create_report() , , SQL-, , , . SQL , , , , create_report().
, , , , , .