Trying to fetch data from users table by user_id which is the foreign key in vehicle table. The relation is working properly like as when I insert data in the vehicle table then user_id also inserting as expected, but the problem is when I want to fetch data from users table using user_id.
I used this SQL query for viewing data
<?php
$qry = mysql_query("select vehicle. *, users.zip AS zip from vehicle JOIN users ORDER BY id DESC ");
while($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 echo $data['bid_type'];?></td>
<td><?php echo $data['zip'];?></td>
<td>
<a href="bid-detail.php?id=<?php echo base64_encode($data['id']);?>" class="btn btn-success btn-small">$ Make Offer</a>
</td>
</tr>
<?php
}
?>
This query displaying data, but it's repeating one again and again.
Anyone can help me please to solve the issue or any other easy solution for this.