tengo esto
Código PHP:
<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Consulta</title>
<style type="text/css">
<!--
.Estilo3 {font-size: 24px; font-style: italic; font-weight: bold; color: #FFFFFF; }
-->
</style>
</head>
<?php
$destino=$_POST['destino'];
require("conectar.php");
$sql='SELECT e.nom_emp, r.num_rut from p_empresas as e, p_ruta as r, p_lugares as l, p_ruta_lugar as rl where l.cod_lug=origen and rl.cod_rutalugar=l.cod_lug and r.cod_rut=rl.cod_rut and e.cod_emp=r.cod_emp and r.cod_rut in (select cod_rut from p_ruta_lugar.cod_lug=destino)';
$resultados = mysql_query($sql);
while($row = mysql_fetch_array($resultados))
{
echo "<body> <table width=836 height=102 border=10 align=center>
<tr>
<td width=291 height=32 bgcolor=#0000CC><div align=center class=Estilo3>Empresa</div></td>
<td width=153 bgcolor=#0099CC><div align=center class=Estilo3>Ruta</div></td>
</tr>
<tr>
<td height=23> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td align=center><b>".$row['nom_emp']."</b></td>
<td align=center><b>".$row['num_rut']."</b></td>
</tr>
</table>
</body>
</html>";
}
?>
Espero pronta respuesta y gracias por la ayuda a los colaboradores