I was able to fix the issue however, when i echo out my client_id there is a lot of repetition, and I tried to put array_unique and distinct but nothing worked, what else is there I could do? I also want it to show all the addresses because some clients have more than one address.
$query1= "Select distinct client_id from client_profile where client_status= 'f'";
$result1= pg_query($conn2, $query1);
$clientid = array();
while($row1 = pg_fetch_array($result1)){
$id=$row1['client_id'];
$clientid[]=$id;
$clientid = array_unique($clientid);
}
//$clientid=array_unique($clientid);
$clientid=implode(',',$clientid);
$query= "select * from vouchers where client_id IN ($clientid)";
$result = pg_query($conn,$query);
?>
<!DOCTYPE html>
<html>
<head>
<title>Inactive Clients</title>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<link href = "http://fonts.googleapis.com/css?family=Roboto:400">
</head>
<body>
<table class="table table-sm">
<thead>
<tr>
<th>Client id</th>
<th>File Name</th>
</tr>
</thead>
<?php
while($row = pg_fetch_array($result))
{
?>
<tbody>
<tr>
<td><?php echo $row['client_id']; ?></td>
<td><?php echo $row['file_name']; ?></td>
</tr>
<?php }?> </tbody>
</table>
</body>
</html>