	<?php
	include ('koneksi.php');
	$list_exhibitor = '';
	$sql = 
	" SELECT distinct nama_company FROM dt_exhibitor ";
	if ($hasil = mysql_query($sql)) {
		while ($data = mysql_fetch_array($hasil)) {
			if ($list_exhibitor) $list_exhibitor .= ',';
			$list_exhibitor .= "'".$data["nama_company"]."'";
		}
	}


	$sql3 = "
	SELECT nama_company, nama_stand, a.id_hall, b.id_hall, nama_hall
	FROM dt_exhibitor as a, dt_hall as b 
	WHERE a.id_hall=b.id_hall
	and nama_company <> '' 
	AND nama_company in ($list_exhibitor) 
	order by nama_company";
	//echo $sql3;
	if ($hasil3 = mysql_query($sql3)) {
		echo '
		<table>
			<tr>
				<td>No.</td>
				<td>nama_company</td>
				<td>nama_stand</td>
				<td>id_hall</td>
				<td>nama_hall</td>
			</tr>';			
			$ctr = 0;
			while ($data3 = mysql_fetch_array ($hasil3)) {
				$ctr++;
				echo '
				<tr>
					<td>'.$ctr.'</td>
					<td>'.$data3["nama_company"].'</td>
					<td>'.$data3["nama_stand"].'</td>
					<td>'.$data3["id_hall"].'</td>
					<td>'.$data3["nama_hall"].'</td>
				</tr>';			
			}
			echo '
		</table>';
	}
?>