-1

Hi everyone i dont know what i am doing wrong the content in the tabs are not displaying the links menu works fine Just i dont know why the content is not loading

Not displaying content

list database [ id ] coin ]

category databse [ categorylist_id ] categorylist_coin ] categorylist_image ]

<?php
    $tab_query = "SELECT * FROM category WHERE categorylist_id  GROUP  BY categorylist_coin ASC";
    $tab_result = mysqli_query($link, $tab_query);
    $tab_menu = '';
    $tab_content = '';
    $i = 0;
    while($rows = mysqli_fetch_array($tab_result))
    {
     if($i == 0)
     {
      $tab_menu .= '
         <li class="active"> <a href="#'.$rows["categorylist_id"].'" data-toggle="tab"><img src="'.$rows["categorylist_image"].'"height="30" width="36" > '.$rows["categorylist_coin"].'</a></li>';
      $tab_content .= '
       <div id="'.$rows["categorylist_id"].'" class="tab-pane fade in active">';
     }
     else
     {
      $tab_menu .= '<li><a href="#'.$rows["categorylist_id"].'" data-toggle="tab"><img src="'.$rows["categorylist_image"].'"height="30" width="36" > '.$rows["categorylist_coin"].'</a></li>';
      $tab_content .= '
       <div id="'.$rows["categorylist_id"].'" class="tab-pane fade">';
     }

    Not displaying any data in the content tab

     $cetegory_query = "SELECT * FROM list WHERE id  = '".$rows["categorylist_id"]."'     ";
     $result = mysqli_query($link, $cetegory_query);
     while($sub_row = mysqli_fetch_array($result))
     {
      $tab_content .= '

      <div class="col-md-3" style="margin-bottom:36px;">
    <table class="table table-striped" id="posts" width="100%" cellspacing="0">
                    <thead>
                    <tr>
                    <th><center>name</center></th>
                    <th><center>owner</center></th>
                   <th><center>timer</center></th>
                    <th><center>website</center></th>
                      </tr>
                    </thead> 
                        <tr> 
    <td>'.$sub_row["faucet_name"].'</td>
      <td><center>'.$sub_row["owner"].'</center></td>
      <td><center>'.$sub_row["timer"].'</center></td>
      <td><center>'.$sub_row["Website"].'</center></td></tr> </table>         
      </div>
      ';
     }
     $tab_content .= '<div style="clear:both"></div></div>';
     $i++;
    }
    ?>

    <ul class="nav nav-tabs">
       <?php
       echo $tab_menu;
       ?>
       </ul>
       <div class="tab-content">
       <br />
       <?php
       echo $tab_content;
       ?>

  • **Warning:** You are wide open to [SQL Injections](https://php.net/manual/en/security.database.sql-injection.php) and should use parameterized **prepared statements** instead of manually building your queries. They are provided by [PDO](https://php.net/manual/pdo.prepared-statements.php) or by [MySQLi](https://php.net/manual/mysqli.quickstart.prepared-statements.php). Never trust any kind of input! Even when your queries are executed only by trusted users, [you are still in risk of corrupting your data](http://bobby-tables.com/). [Escaping is not enough!](https://stackoverflow.com/q/32391315) – Dharman May 14 '22 at 12:44

0 Answers0