且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 PHP 和 MySQL 中防止 SQL 注入登录页面

更新时间:2023-02-05 21:53:45

使用准备好的语句,

http://php.net/manual/en/pdo.prepared-声明.php

$stmt = mysqli->prepare("select user_id from users where user_name= ? and password= ?");
$stmt->bindParam("ss",$username,$pass);
$stmt->execute();