使用预准备语句和mysqli_stmt_bind_param时是否仍存在注入风险?
例如:
$malicious_input = 'bob"; drop table users';
mysqli_stmt_bind_param($stmt, 's', $malicious_input);
Run Code Online (Sandbox Code Playgroud)
在幕后,mysqli_stmt_bind_param将此查询字符串传递给mysql:
SET @username = "bob"; drop table users";
Run Code Online (Sandbox Code Playgroud)
或者它是通过API执行SET命令,还是使用某种类型的保护来防止这种情况发生?