title: If statement to check if existing entry is in database
body: <p>Trying to figure out why my code isn't working. Basically I have an elseif statment like so:</p>
  
  <pre><code>mysql_connect("localhost","xxxx","xxxxx");
  mysql_select_db("xxxxxx");
  $sql = "SELECT COUNT(DATE) FROM calendar";
  $result = mysql_query($sql);
  $row = mysql_fetch_assoc($result);
  
  $checkdate = $row['DATE'];
  $DATEFROM = $_POST['DATEFROM'];
  $DAYCOUNT = $_POST['DAYCOUNT'];
  $DAYS = $_POST['DAYS'];
  
  
  if ( $DAYCOUNT &lt; $DAYS ) { 
      header( 'Location: request_go_fail.php' );
  }
  else if ( $checkdate == $DATEFROM ) {
      echo "FAIL!";
  }
  else {
  </code></pre>
  
  <p>It doesn't work, the first check (to see if the DAYCOUNT is less than DAYS works fine, but when comparing to entries in the DB it doesn't seem to do it. Seems to be some issue with finding the already existing data, as when I change $checkdate to an entry that's already in the database it works great. </p>
  
  <p>Any help is most appreciated :)</p>