o ci sei o ci fai....
codice:
<?php
// The basic SELECT statement
$select = 'SELECT DISTINCT id, prezzo, tipologiaid';
$from = ' FROM immobile';
$where = ' WHERE 1=1';
$aid = $_POST['aid'];
if ($aid != '') { // e selezionata una tipologia
$where .= " AND tipologiaid='$aid'";
}
$searchte = $_POST['searchte'];
if ($searchte != '') { // Some search text was specified
$where .= " AND prezzo LIKE '%$searchte%'";
}
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#336699" class="entryTable">
<tr id="entryTableHeader">
<td><div align="center">CODICE</div></td>
<td><div align="center">TIPOLOGIA</div></td>
</tr>
<?php
$immobili = @mysql_query($select . $from . $where);
if (!$immobili) {
exit('
Errore !
'.
'Error: ' . mysql_error() . '</p>');
}
$sql22 = @mysql_query( "SELECT name FROM tipologia, immobile WHERE tipologiaid=tipologia.id ");
if (!$sql22) {
exit('
Error performing query: ' . mysql_error() . '</p>');
}
while ($imm = mysql_fetch_array($sql22)) {
$name = $imm['name'];
while ($immobile = mysql_fetch_array($immobili)) {
echo "<tr>";
$id = $immobile['id'];
$prezzo = htmlspecialchars($immobile['prezzo']);
$tipologiaid = htmlspecialchars($immobile['tipologiaid'
]);
echo "<td ><center>$id</center></td>";
echo "<td class='contentArea'><center>$name</center></td>";
echo "<td class='contentArea'><center>$prezzo</center></td>";
echo "</tr>";
}
}
?>
secondo te e' cambiato qualcosa????