title: Adding either DISTINCT or GROUP BY to my mysql_query is causing no values to be returned
body: <p>I am using php to get records from a mysql database using the following code:</p>
  
  <pre><code>&lt;?php
      $username="";
          $password="";
          $database="";
          $hostname="";
  
                 $con = mysql_connect($hostname, $username, $password);
  
          if (!$con){
              die('Could not connect: ' . mysql_error());
          }
  
          mysql_select_db($database, $con);
  
  
      if(isset($_POST['emp'])){
          $emp = $_POST['emp'];
          $result = mysql_query("SELECT * FROM contact_log", $con);
          echo mysql_num_rows($result);
          die();
          while($row = mysql_fetch_array($result)){
              $emp = $row['emp'];
              echo $emp.'&lt;br&gt;';
          }
          die();
      }
  
          mysql_close($con);
  ?&gt;
  </code></pre>
  
  <p>This works fine and returns the correct fields. The problem is that if I change the query to </p>
  
  <pre><code>$result = mysql_query("SELECT DISTINCT * FROM contact_log", $con);
  </code></pre>
  
  <p>or </p>
  
  <pre><code>$result = mysql_query("SELECT * FROM contact_log GROUP BY emp", $con);
  </code></pre>
  
  <p>no results are returned.</p>
  
  <p>mysql_num_rows does not even return a value which indicates to me that those lines are breaking my code but I am unable to figure out how.</p>