title: PHP: How to run this IF statement
body: <p>I ran this script, but I keep getting the "did not work" message I put in it. I know that the value in the db is correct, it must be something in my PHP...</p>
  
  <pre><code>            $getadmin = "SELECT role FROM user WHERE user_id=$uid";     
              $showadmin = @mysqli_query ($dbc, $getadmin); // Run the query.
  
              $admin = mysqli_fetch_assoc($showadmin);
              if($admin == 'admin'){  
  
              echo 'You are an admin!';
  
              } else {
  
              echo 'Did not work';
  
              }
  </code></pre>