<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$query="Select distinct bacodfam,
iif(bfmdescr is null,'famiglia non presente',trim(bfmdescr)) as Descrizione
FROM b2bart
LEFT join b2bfam on bacodfam=bfmcod
";
$results2=sqlsrv_query($conn,$query);
//$row=0;
while($art=sqlsrv_fetch_array($results2,SQLSRV_FETCH_NUMERIC)){
echo "<tr class= 'table table-sm'>
<td>".$art[0]."</td>
<td>".$art[1]."</td>
</tr>";
}
sqlsrv_close( $conn );
?>
</body>
</html>