Learn about these things:
Cross-Site Scripting (XSS)
SQL injection
For additional security and error prevention always declare(strict_types=1); and use TYPE CASTING for INTEGERS coming from user inputs.
declare(strict_types=1);
When taking in a value with $_GET then one step for hardening the system would be using type casting:
$_GET
$id = (int) $_GET['id']; $stmt = $pdo->prepare("SELECT * FROM `notes` WHERE `id` < {$id}");
Never combine or insert
PS! SQL injections are super big SECURITY ISSUE and therefore should be taken very seriously. PDO uses placeholders
PDO
There was an error while loading. Please reload this page.