SQL built with variable interpolation (PHP)
Part of Security, which counts for 30% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.
What it detects
A query() call embeds a $variable directly inside the SQL string rather than using a prepared statement with bound parameters.
Why it matters
Embedding a $variable inside the SQL string passed to query() sends the value as part of the query text, so a crafted value can inject SQL. Prepared statements with bound parameters remove the risk. This is a heuristic: a variable holding a trusted constant would be a false positive.
How to fix it
Use prepared statements: PDO prepare() with named or ? placeholders and execute([...]), or mysqli prepare()/bind_param(). If you use a framework, use its query builder or Eloquent bindings. Never interpolate a variable into the SQL string.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo