kphp
kphp copied to clipboard
PDO prepared statements
In PHP there are prepared statements to speed up and simplify the work with PDO
Example:
$request = $db->prepare('SELECT * FROM issues WHERE likes < :likes AND author = :author');
$request->execute(['likes' => 100, 'author' => 'Einstein']);
$answers = $request->fetchAll();
This functionality should be added to KPHP because:
- It can protect code from SQL injections
- It helps speed up queries, since the database can parse the expression