Carousel bringing a table with information from the database

0

This is what I wanted to know if it's possible to put a table into the carousel, bringing the data in 5 lines, when I complete 5 lines the next data would continue on the next page, it would work there as a pagination of a table. I've tried, but I'm only able to page one line. Please guys help me !!!

<?php include'conexao.php'; ?>
<html>
    <head>
         
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><scriptsrc="js/jquery-3.2.1.min.js" ></script>
        <link type="text/css" rel="stylesheet" href="css/bootstrap.css" >
        <script src="js/bootstrap.js"></script>
        <link rel="stylesheet" type="text/css" href="css/index.css">
        
    </head>
    <body>
    <div align="center">
        <form id="conteudo" >
            <div id="myCarousel" class="carousel slide" data-ride="carousel">
      <!-- Indicators -->
      <ol class="carousel-indicators">
           <?php
                $ctrAtivo = 2 ; 
                $ctrSlide = 1 ;
                $sql = "SELECT * FROM exames ORDER BY id ASC";
                    
                $resultados = mysqli_query($con,$sql);
                
                while($rows = mysqli_fetch_assoc($resultados)){ 
          ?>
                   
                <?php  if($ctrAtivo == 2){ ?>
          
                     <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
          
          <?php                                    
            $ctrAtivo = 1;                                  
          }else{ ?>
          
                    <li data-target="#myCarousel" data-slide-to="<?php echo $ctrSlide ?>"></li>
          <?php
              $ctrSlide++;
          }
            ?>  
        
          <?php
                            
                }
            
            ?>
          
      </ol>
      <div class="carousel-inner" role="listbox">
          <?php
                $ctrAtivo = 2 ; 
            
          
                $sql = "SELECT * FROM exames ORDER BY id ASC";
                    
                $resultados = mysqli_query($con,$sql);
                
                while($rows = mysqli_fetch_assoc($resultados)){ 
          ?>
                   
                <?php  if($ctrAtivo == 2){ ?>
          
                     <div class="item active">
                             <table border="1">
                
                                   <tr>
                                        <td><?php echo"$rows[paciente]"; ?></td>
                                        <td><?php echo"$rows[medico]"; ?></td>
                                        <td><?php echo"$rows[crm]"; ?></td>

                                   </tr>

                               </table>
                    
                      <div class="container">
                        <div class="carousel-caption">
                          
                        </div>
                      </div>
                    </div>
          
          <?php                                    
            $ctrAtivo = 1;                                  
          }else{ ?>
          
                <div class="item ">
                             <table border="1">
                
                                   <tr>
                                        <td><?php echo"$rows[paciente]"; ?></td>
                                        <td><?php echo"$rows[medico]"; ?></td>
                                        <td><?php echo"$rows[crm]"; ?></td>

                                   </tr>

                               </table>
                    
                      <div class="container">
                        <div class="carousel-caption">
                          
                        </div>
                      </div>
                    </div>   
          
          <?php
          }
            ?>  
        
          <?php
                            
                }
            
            ?>
          
      <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
      </a>
      <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
      </a>
        </div>
          
    </div>
    
     </form>
     
     
</div> 
    
    
    </body>
</html> 
    
asked by anonymous 13.10.2017 / 00:26

0 answers