sql - Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given PHP -


i'm newbie on php , want select data joined tables can't =/

can me?

i'm getting error warning:

mysqli_num_rows() expects parameter 1 mysqli_result, boolean given

this code:

 <?php    $consulta = mysqli_query($conexao,"select exercicios.nome_exercicio  nome_exc , exercicios.repeticoes_exercicio  rep_exc , exercicios.serie  serie_exc exercicios                                      inner join usuarios on usuarios.id_usuario = exercicios.id_usuario                                     id_usuario  = usuarios.id_usuario   ");     if(mysqli_num_rows($consulta) > 0)   {        while ($exercicio = mysqli_fetch_assoc($consulta))           {   echo "<div class='table-responsive'><table class='table table-responsive'>     <tr><td></td><td>nome</td><td>repetições</td><td>série</td></tr>      <td>'".$exercicio['nome_exc']."'</td>     <td>'".$exercicio['rep_exc']."'</td>     <td>'".$exercicio['serie_exc']."'</td>    </table></div> ";      } }   else {     echo "seu instrutor ainda não cadastrou exercícios";  }      ?> 

seems have problem in query .

valid query -:

select exercicios.nome_exercicio nome_exc,    exercicios.repeticoes_exercicio rep_exc,    exercicios.serie serie_exc  exercicios inner join usuarios on usuarios.id_usuario = exercicios.id_usuario 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -