Question: Basically, I have been having some trouble with sending a request to a MySQL server and receiving the data back and checking if a user is an Admin or just a User.

Admin = 1
User = 0

```
<?php 
$checkAdminQuery = "SELECT * FROM `users` WHERE `admin`";
$checkAdmin = $checkAdminQuery
mysqli_query = $checkAdmin;

if ($checkAdmin == 1) {
echo '<h1>Working!</h1>';
}else {
echo '<h1>Not working!</h1>'; 
}

?>

```

Sorry that this may not be as much info needed, I am currently new to Stack Overflow.

Answer: 
Firstly, your SQL query is wrong

```
SELECT * FROM `users` WHERE `admin`

```

It's missing the rest of the WHERE clause

```
SELECT * FROM `users` WHERE `admin` = 1

```

Then you're going to need fetch the result from the query results. You're not even running the query

```
$resultSet = mysqli_query($checkAdminQuery)

```

Then from there, you'll want to extract the value. 

```
while($row = mysqli_fetch_assoc($resultSet))
{
    //do stuff
}

```

These are the initial problems I see, I'll continue to analyze and find more if needed.

See the documentation here

<http://php.net/manual/en/book.mysqli.php>
// get all admin users (assumes database already connected)

```
$rtn = array();
$checkAdminQuery = "SELECT * FROM `users` WHERE `admin`=1";
$result = mysqli_query($dbcon,$checkAdminQuery) or die(mysqli_error($dbconn));

while($row = mysqli_fetch_array($result)){
   $rtn[] = $row;
}

```