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: 
You need to have something like user id if you want to check someone in database. For example if you have user id stored in session

```
<?php
// 1. start session
session_start();
// 2. connect to db
$link = mysqli_connect('host', 'user', 'pass', 'database');
// 3. get user
$checkAdminQuery = mysqli_query($link, "SELECT * FROM `users` WHERE `id_user` = " . $_SESSION['id_user'] );
// 4. fetch from result
$result = mysqli_fetch_assoc($checkAdminQuery);

// 5. if column in database is called admin test it like this
if ($result['admin'] == 1) {
  echo '<h1>Is admin!</h1>';
}else {
  echo '<h1>Not working!</h1>'; 
}
?>

```
```
$checkAdminQuery = "SELECT * FROM `users` WHERE `admin`"; !!!!

```

where what ? you need to specify where job = 'admin' or where name ='admin'
you need to specify the column name where you are adding the admin string