title: MySQL SELECT INNER JOIN mistaken
body: <p>I am trying to retrieve the 'Roles' sets of a given users.id on a query with INNER JOIN combined with a WHERE condition. But things go wrong.</p>
  <p>My database has four tables:</p>
  <pre><code>t_users : id, username, userpass, status, ...
  t_action: id, id_user, id_role, id_type_role, ...
  t_role: id, libelle, status
  t_type_role: id, libelle, status
  </code></pre>
  <p>My query:</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT U.id AS ID, R.libelle AS ROLE, T.libelle AS TYPE
  FROM t_user U
  JOIN t_action A ON A.id_user = U.id
  JOIN t_type_role T ON T.id = A.id_type_role
  JOIN t_role R ON R.id = A.id_role
  WHERE A.id_user = '1' AND R.libelle = 'System'
  
  </code></pre>
  <p>But this query returns no data. (Tested on a phpmyadmin SQL board.)</p>