Medoo PHP Framework Using AND

522 Views Asked by At

I am using the Medoo Framework for a project. I've only started using it so I'm not totally up to speed with exactly how it works.

Anyway, I'm trying to run a simple query that uses SELECT and AND. However, as far as I can see the Medoo website doesn't state how to implement the AND part of the query.

I've tried a number of ways none of which work. The code below is what I currently have - it doesn't work though. If I enter a correct email address and an incorrect password the query will still return the user.

$registeredUser = $database->select("admins", "*",[
            "admin_email" => $validAdminEmail,
            "AND" => ["admin_password" => $hashedAdminPassword]
]);

Any help is much appreciated :)

1

There are 1 best solutions below

0
On

It looks like you've figured it out already, but here's the answer for other people wondering about the same thing.

$registeredUser = $database->select("admins", "*", [
    "AND" => [
        "admin_email" => $validAdminEmail,
        "admin_password" => $hashedAdminPassword]
]);