ho cambiato la query adesso non mi duplica piu' gli hotel ma mette gli stessi risultati della tabelle offerte per ogni hotel presente nella tabella hotel, mammamia sto codice mi fa impazzire!!
vi scrivo il codice della pagina index cosi' magari potete individuare il problema!!
Grazie
Codice PHP:
<?
require_once ('conn.php');
$query = 'SELECT * FROM hotel WHERE stato="aperto" ORDER by idhotel ASC';
$result=mysql_query($query);
while ($row=mysql_fetch_array($result)) :
?>
<table align="center" class="ischia_box" border="0" cellpadding="0" cellspacing="0" width="520">
<tbody>
<tr align="center">
<td height="60" width="90" class="tipologia"><div align="center"><? echo '<h2> ' . $row['tipologia'] . ' </h2>';?></div></td>
<td width="452" height="60" align="left"><div align="left"><? echo '<h2><a class="b" href="hotel_ischia.php?id=' . $row['idhotel'] .
'">' . $row['nome'] .'</h2></a></th>'; ?></div> </td>
</tr>
</tbody>
</table>
<table align="center" class="ischia_box_nolinea" border="0" cellpadding="0" cellspacing="0" width="520">
<tbody>
<tr valign="top">
<td height="506"> <div class="ischia_txt4" align="center">
</p>
<table border="0" cellpadding="0" cellspacing="0" width="500">
<tbody>
<tr valign="top">
<td align="left" class="descrizione-hotel" height="143" width="280"><? echo ' ' . $row['descr_breve'] . ' ';?></td>
<td width="220"><div align="center">
<? echo ' ' . $row['dal'] . ' ';?></div></td>
</tr>
</tbody>
</table>
<strong class="ischia_supplementi_2">[/b]<? require_once ('conn.php');
$query2 = 'SELECT * FROM hotel INNER JOIN offerte ON hotel.idhotel=offerte.idhotel';
$result2=mysql_query($query2);
while ($row=mysql_fetch_array($result2)) :
?>
<table class="ischia_box_interno" border="0" cellpadding="0" cellspacing="0" width="500">
<tbody>
<tr>
<td bgcolor="#59770e">
<div class="ischia_testo" align="center">[b]<? echo ' ' . $row['nome_offerta'] . ' ';?>[/b]</div></td>
</tr>
<tr valign="top">
<td height="178" width="500">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="440">
<tbody>
<tr>
<td>
<div align="center"><span class="data_hotel">[b]Dal <? echo ' ' . $row['dal'] . ' ';?> Al <? echo ' ' . $row['al'] . ' ';?> [/b]</span></div></td>
</tr>
<tr>
<td>
<div align="center"><span class="ischia-euro">[b]<? echo ' ' . $row['prezzo'] . ' ';?> EURO[/b]</span>
<span class="ischia_txt1">[b]AL GIORNO PER [/b]</span><span class="ischia_txt2">[b] PERSONA [/b]</span><span class="ischia_txt1">[b]IN <? echo ' ' . $row['trattamento'] . ' ';?>
[/b]</span></div></td>
</tr>
</tbody>
</table>
<span class="descrizione-hotel"> <strong class="ischia_txt3">INCLUSO NEL PREZZO:[/b] <? echo ' ' . $row['incluso'] . ' ';?></span></p>
</p>
</div></td>
</tr>
</tbody>
</table
>
<?
endwhile;
mysql_close($query);
?>
<table border="0" cellpadding="0" cellspacing="0" width="500">
<tbody>
<tr>
<td width="25"><div align="center">[img]ischia_images/ischia_hotel_mail_blu.jpg[/img]</div></td>
<td class="menu" width="278">[email="info@ischiatravelnet.com"]<? echo ' ' . $row['email'] . ' ';?>[/email]</td>
<td width="197"><div class="ischia-offerte" align="center">[b][img]ischia_images/schia-telefono.gif[/img] [/b]<strong class="ischia-offerte"><? echo ' ' . $row['tel'] . ' ';?>[/b]</div></td>
</tr>
</tbody>
</table>
</p>
</div></td>
</tr>
</tbody>
</table>
<span class="ischia_txt4">
<?
endwhile;
mysql_close($query2);
?>
</span></td>
</tr>
<tr> </tr>
<tr> </tr>
</tbody>
</table>
</div></td>
</tr>
</tbody></table>
</div>
<div align="center"></div>
<div align="center">
<table class="ischia_boxsotto" border="0" cellpadding="0" cellspacing="0" width="740">
<tbody>
<tr>
[email]fo@ischiatravelnet.com[/email]" class="ischia_vedisito">info@ischiatravelnet.com</a>[/b]</span></div></td>
</tr>
</tbody>
</table>
</div>
</body></html>