Trying to view individual row from the relational table according to id like as if I click a button then I want to view this row in an iframe modal with the new tab. It's working as expected also parent table data, but the issue is child table data it's always showing one for all id.In the below I added screenshot also my code.
In the below screenshot date column is working as expected when I click view button the problem is other columns those coming from the child table.
This is the modal screenshot which will open by clicking on the view button
Code:
<?php
$id= $_GET['id'];
$qry = mysql_query("select t.*, u.zip AS zip, u.acct_type AS acct_type from transport as t,users as u WHERE t.id=$id ");
if($qry === FALSE) {
die(mysql_error()); // TODO: better error handling
}
$data = mysql_fetch_array($qry);
?>
<tr role="row" class="even">
<td style="display:none;"><?php echo $data['id'];?></td>
<td class="sorting_1">
<?php
$datess = $data['create_date'];
$old_date_timestamp = strtotime($datess);
echo date('m-d-Y', $old_date_timestamp);
?> </td> <td> <?php
$acct_type = $data['acct_type'];
if($acct_type == 0)
{
echo "Admin";
}
elseif($acct_type == 3)
{
echo "User";
}
elseif($acct_type == 4)
{
echo "Guest User";
}
elseif($acct_type == 5)
{
echo "Administrator";
}
else
{
echo "Trial User";
}
?>
</td>
<td><?php echo $data['zip'];?></td>
</tr>
There users table is child table
Anyone can help me please where the bug?