我有一个基本的疑问。
我有这个例子:
$sql = mysql_query("SELECT * FROM admin where id = username='$username' and password = '$password' LIMIT 1");
有可能在浏览器中看到这个 sql 命令在做什么吗?看看对不对。。
谢谢。
$a = "SELECT * FROM admin where id = username='$username' and password = '$password' LIMIT 1";
echo $a;
$sql = mysql_query($a); // use mysqli instead
if you will print the $sql it will print #resurce #4
you need to do:
$q = "SELECT * FROM admin where id = username='$username' and password = '$password' LIMIT 1";
print_r($q);
and you see it in the network tab on the console or in the browser if you print your request