I work across PHP, Python, Ruby and plain SQL, and one thing I keep noticing in code reviews is that every stack has its own "safe" way to build queries, and people still end up concatenating strings when a query gets dynamic (search filters, ORDER BY, IN lists, etc.). [PSYOUTUBE|2eC8-9EnBPE] So I'm curious what everyone…
<?php
$stmt = $pdo->prepare('SELECT id, name FROM users WHERE email = :email');
$stmt->execute([':email' => $email]);
$user = $stmt->fetch(PDO::FETCH_ASSOC);cur.execute("SELECT id, name FROM users WHERE email = ?", (email,))
user = cur.fetchone()
