title: Display single result from database where ID matches using mysql and php
body: <p>I am having some trouble displaying a single field from the db based on an ID number.  </p>
  
  <p>I want to  trying to display the "C_Type_of_Referral" if the ID matches.  I am sure the code is a mess of crap but I am still at the VERY early stages of learning how to do things in mysql and php.</p>
  
  <pre><code>$query = "SELECT C_Type_of_Referral FROM Ctable WHERE C_ID = '70'";
  $result = mysql_query($query) or die('Error : ' . mysql_error());
  list($C_Type_of_Referral) = mysql_fetch_array($result);
  </code></pre>
  
  <p>Then I am trying to display the result using the code below:</p>
  
  <pre><code>echo ((isset ($_POST['C_Type_of_Referral']) &amp;&amp; $_POST['C_Type_of_Referral'] == 'AS') || ($C_Type_of_Referral == 'AS'));
  </code></pre>
  
  <p>The code above returns the value of 1.</p>
  
  <pre><code>echo ($_POST['C_Type_of_Referral']);
  </code></pre>
  
  <p>The code above returns nothing.</p>
  
  <p>Where am I going wrong?</p>
  
  <p>Thanks for any help!</p>