如何检查我的Mysql数据库中是否存在用户名或密码

问题描述:

这是我必须检查用户名或密码是否存在:



$ result = $ db-> query(SELECT username FROM users);

$ un2 = $ result;

if($ un!= $ un2){

$ result = $ db-> query( 从用户中选择密码);

$ pswd3 = $ result;

if($ pswd!= $ pswd3){



有什么不对的,还有另外一种方法或方法可以解决它吗?



请不要生气,我只是14,我的最高知识是8年级中学我明年开始上高中,这是我的第一个大编码项目。

here's what i have to check if a username or password exsists:

$result = $db->query("SELECT username FROM users");
$un2 = $result;
if ($un != $un2) {
$result =$db->query("SELECT password FROM users");
$pswd3 = $result;
if($pswd != $pswd3){

is there something wrong, and is there another way or a way to fix it?

Please don't be mad, I'm only 14, my highest knowledge is 8th grade middle school i start high school next year, this is my first big coding project.

result =


db-> query(SELECT username FROM users);
db->query("SELECT username FROM users");


un2 =