Group by causes 500 internel server error
<p>I've made a webapplication , tested it on localhost works perfectly. Put it on my server and on a <code>GROUP BY</code> in a query it outputs an empty screen with an <code>500 internal server error</code> in the console.</p>

<pre><code>  $sth = $db-&gt;prepare('SELECT users.username FROM users INNER JOIN questions ON users.question_id=questions.id  WHERE questions.question_list_pass = "'.$ww.'" GROUP BY users.username ORDER BY users.username');
  $sth-&gt;execute();
  $usernames = $sth-&gt;fetchAll(PDO::FETCH_ASSOC);

  $sth = $db-&gt;prepare('SELECT questions.id, questions.question_name FROM 
questions INNER JOIN users ON users.question_id=questions.id WHERE questions.question_list_pass = "'.$ww.'" GROUP BY questions.question_name ORDER BY questions.question_name');
  $sth-&gt;execute();
  $question_names = $sth-&gt;fetchAll(PDO::FETCH_ASSOC);
</code></pre>

<p>The first query is identical to the second exept for getting data from different tables. When I run the script it outputs a <code>500 internal server error</code> and when I <em>remove</em> the <code>GROUP BY questions.question_name</code> from the second query (but still keep the order by) the script works BUT it outputs everything multiple times (because the order by won't work properly) </p>

<p>Any ideas how this is possible? I've let different people look at it but nobody has a clue what's incorrect. </p>

<p>With kind regards,</p>