title: Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given PHP
body: <p>I want to select data from joined tables.</p>
  
  <p>I'm getting an error Warning: </p>
  
  <blockquote>
    <p>mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean
    given</p>
  </blockquote>
  
  <p>This is the code:</p>
  
  <pre><code>&lt;?php
  
  $consulta = mysqli_query($conexao, "SELECT exercicios.nome_exercicio AS  nome_exc , exercicios.repeticoes_exercicio  AS rep_exc , exercicios.serie  AS serie_exc FROM exercicios 
      INNER JOIN usuarios ON usuarios.id_usuario = exercicios.id_usuario
      WHERE id_usuario  = usuarios.id_usuario
  ");
  
  if (mysqli_num_rows($consulta) &gt; 0) {
      while ($exercicio = mysqli_fetch_assoc($consulta)) {
          echo "&lt;div class='table-responsive'&gt;&lt;table class='table table-responsive'&gt;
  
  &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;Nome&lt;/td&gt;&lt;td&gt;Repetições&lt;/td&gt;&lt;td&gt;Série&lt;/td&gt;&lt;/tr&gt;
  
  &lt;td&gt;'".$exercicio['nome_exc']."'&lt;/td&gt;
  &lt;td&gt;'".$exercicio['rep_exc']."'&lt;/td&gt;
  &lt;td&gt;'".$exercicio['serie_exc']."'&lt;/td&gt;
  
  
  &lt;/table&gt;&lt;/div&gt; ";
      }
  } else {
      echo "Seu instrutor ainda não cadastrou exercícios";
  }
  </code></pre>