Read data from multiple tables.... . Can anyone figure out why this code won't work... . When I make checkbox selection, the alert (script) is showing up, . I known there should be come a result of data. . Manny thanks, Benny
<?php
 include_once 'dbcon.php';
 if(isset($_POST['chk'])=="")
 {
  ?>
    <script>
  alert('Er moet tenminste één checkbox geselecteerd zijn !!!');
  window.location.href='../EVENT/eventIndex.php';
  </script>
<?php
 }
 $chk = $_POST['chk'];
 $chkcount = count($chk);
?>    
<form method="post" name="frm">
<table width="90%" align="center" border="0">
    <tr>
        <td colspan="6"><a href="NewTicket.php" class="StyleTxt">Voeg een nieuw ticket toe...<br>
        </a></td>
    </tr>
    <tr>
        <th width="15%" class="StyleTxt">Naam</th>
        <th width="15%" class="StyleTxt">Voornaam</th>
        <th width="15%" class="StyleTxt">Partner achternaam</th>
        <th width="15%" class="StyleTxt">Partner voornaam</th>
        <th width="15%" class="StyleTxt">Herbalife-ID</th>
        <th width="15%" class="StyleTxt">Upline</th>
    </tr>
<?php  
for($i=0; $i<$chkcount; $i++)
{
$id = $chk[$i];
$res=$MySQLiconn->query("SELECT user.FName, user.LName, user.HerbalifeID, user.UplineS, registratie.PartnerFName, registratie.PartnerLName, registratie.NaamVIP1, registratie.NaamVIP2, registratie.NaamVIP3, registratie.NaamVIP4, registratie.NaamVIP5, registratie.NaamVIP6, registratie.NaamVIP7, registratie.NaamVIP8, registratie.NaamVIP9, registratie.NaamVIP10, registratie.NaamVIP11, registratie.NaamVIP12 FROM registratie INNER JOIN user ON registratie.userID = user.UserID AND registratie.eventID=".$id);
 while($row=$res->fetch_array())
 {
?>
   <tr>
<td style="background-color:gold;"><?php echo $row['FName'];?></td>
<td style="background-color:gold;"><?php echo $row['LName'];?></td>
<td style="background-color:gold;"><?php echo $row['PartnerFName'];?></td>
<td style="background-color:gold;"><?php echo $row['PartnerLName'];?></td>
<td style="background-color:gold;"><?php echo $row['HerbalifeID'];?></td>
<td style="background-color:gold;"><?php echo $row['UplineS'];?></td><br />
</tr>
<tr>
<td>VIP: <?php echo $row['NaamVIP1'];?></td>
<td>VIP: <?php echo $row['NaamVIP2'];?></td>
<td>VIP: <?php echo $row['NaamVIP3'];?></td>
<td>VIP: <?php echo $row['NaamVIP4'];?></td>
<td>VIP: <?php echo $row['NaamVIP5'];?></td>
<td>VIP: <?php echo $row['NaamVIP6'];?></td>
</tr>
<tr>    
<td>VIP: <?php echo $row['NaamVIP7'];?></td>
<td>VIP: <?php echo $row['NaamVIP8'];?></td>    
<td>VIP: <?php echo $row['NaamVIP9'];?></td>
<td>VIP: <?php echo $row['NaamVIP10'];?></td> 
<td>VIP: <?php echo $row['NaamVIP11'];?></td>
<td>VIP: <?php echo $row['NaamVIP12'];?></td> 
   </tr> 
<?php
  } 
 }
?>
 
    