If Statement proper formula
<p>I have looked on here about if statements. I have found a few things but I am having issues figuring out the proper statement formula.</p>

<p>I have 2 tables in the database with the following 2 fields</p>

<pre><code>table 1
rct_app_id

table 2
uid
</code></pre>

<p>now if the uid field matches the rct_app_id field I want it to</p>

<pre><code>echo "Green Light";
</code></pre>

<p>if they don't match</p>

<pre><code>echo "No Go"
</code></pre>

<p>this is my formula</p>

<pre><code>&lt;?php

      $user_id = $_SESSION['uid'];

      $sql = "SELECT * FROM recruits WHERE rct_app_uid = {$user_id}";
      $result = query($sql);

      $rct_app_id = ['rct_app_id'];

      if ($rct_app_id == 'uid') {

          echo  "Green Light";

      } else {

          echo  "No Go";
    }

?&gt;

function query($query)
{
    global $connection;
    return mysqli_query($connection, $query);
}
</code></pre>