Allora, rieccomi , questo è quello che ho, dopo un pò di modifiche !!
[php]<TITLE>CERCA</TITLE>
<link rel='stylesheet' href='stile.css' type='text/css'>
<style type="text/css">
<!--
body {
background-color: #999;
}
-->
</style><br>
<br><br>
<h1>
<table width="389" height="167" border="0" align="center">
<tr>
<td width="326"><table width="300" border="0" align="center">
<tr>
<td align="center"><h2><img src="logo.jpg" alt="" /></h2></td>
</tr>
<tr>
<td align="center" bgcolor="#FFEAEA"><a href="cerca.php"><font color=" blue">
<b>Cerca un servizio</b></font>
</a></td>
</tr>
<tr>
<td align="center" bgcolor="#FFEAEA"><a href="RSE/db-rse.php"><font color=" blue">
<b>modifica un servizio</b></font>
</a></td>
</tr>
<tr>
<td align="center" bgcolor="#FFEAEA"><a href="index.htm"><font color=" blue">
<b>Inserisci un servizio</b></font>
</a></td>
</tr>
<tr>
<td align="center" bgcolor="#AEFFAE"><p> la ricerca per data và effettuata nel formato<br> anno-mese-giorno
(es. 2009-10-14).<br>
è possibile cercare solo l anno ( es. 2009 )<br>
o solo il mese ( es. 2009-10 )<br>Primo campo obbligatorio<br><br>
<?
//controlo che se il 2° modulo del form è vuoto prenda gli stessi valori del primo,
// in modo da non doverli necessariamente compilare tutti e due
if($cerca1=="zz" and $dato1==""){$cerca1=$cerca and $dato1=$dato;}
else {$cerca1=$_POST['cerca1'] and $dato1=$_POST['dato1'];}
$cerca=$_POST['cerca'];
$dato=$_POST['dato'];
if($dato==""){echo "<font color=\"red\"><h3>Se scrivi un testo da cercare è meglio!</h3></font><br>";}
if($cerca=="zz"){echo "<font color=\"red\"><h3>Pirlone!<br>Non hai inserito la categoria</h3></font><br>";}
// richiamo il file di configurazione
require 'config.php';
// richiamo connessione a MySQL
require 'connect.php';
echo "<table width="100%">";
echo "<tr>";
echo "<form name=cerca action='' method=post>";
echo "<td >Dato da cercare :<input type="text" name="dato">";
echo "in <select size=1 name="cerca">
<option value="zz" >seleziona</option>
<option value="reporter">reporter</option>
<option value="n">nastro</option>
<option value="argomento">argomento</option>
<option value="operatore">operatore</option>
<option value="redazione">redazione</option>
<option value="intervista">intervistato</option>
<option value="data ">data</option>
</select> ";
echo "<br>Dato da cercare :<input type="text" name="dato1">";
echo "in <select size=1 name="cerca1">
<option value="zz" >seleziona</option>
<option value="reporter">reporter</option>
<option value="n">nastro</option>
<option value="argomento">argomento</option>
<option value="operatore">operatore</option>
<option value="redazione">redazione</option>
<option value="intervista">intervistato</option>
<option value="data ">data</option>
</select> ";
echo "<tr><td><input type="submit" value="Invia" name="Antenna3">";
echo "<input type="reset" value="RESET" name="Antenna3"></FORM></td></tr></TABLE>";
//provo ad inserire un altro pulsante per visualizzare l'ultimo record inserito
//echo "<input type="button" value="Ultimo servizio" onclick="javascript:location.href='query_ultimo.php'"></FORM></td></tr></TABLE>";
//SELECT id FROM nometabella ORDER BY id DESC LIMIT 0,1
if($cerca!="zz" and $dato!=""){
$cerca=mysql_query("Select * from antenna3 where $cerca like '%$dato%'AND $cerca1 LIKE '%$dato1%'ORDER BY data DESC");
echo "<br>I risultati ottenuti:<br><br>";
while ($data = mysql_fetch_object($cerca))
{
$id = stripslashes($data->id);
$time = stripslashes($data->data);
$redazione = stripslashes($data->redazione);
$operatore = stripslashes($data->operatore);
$reporter = stripslashes($data->reporter);
$nastro = stripslashes($data->nastro);
$n = stripslashes($data->n);
$na = stripslashes($data->na);
$trak = stripslashes($data->trak);
$localita = stripslashes($data->localita);
$luogo = stripslashes($data->luogo);
$argomento = stripslashes($data->argomento);
$intervista= stripslashes($data->intervista);
$inte = stripslashes($data->inte);
$inter = stripslashes($data->inter);
$interv = stripslashes($data->interv);
$intervi = stripslashes($data->intervi);
$intervis = stripslashes($data->intervis);
$ore = stripslashes($data->ore);
$minuti = stripslashes($data->minuti);
$secondi = stripslashes($data->secondi);
$frame = stripslashes($data->frame);
$tg = stripslashes($data->tg);
$edizione = stripslashes($data->edizione);
if($id!="") { echo"id : <font color=blue><b>$id</font></b>";}
if($time!="") { echo"<br>Data : <font color=blue><b>$time</font></b>";}
if($redazione!="") { echo"<br>redazione: <b><font color=blue>$redazione</font></b>";}
if($argomento!="") { echo"<br>argomento: <b><font color=blue>$argomento</font></b>";}
if($intervista!="") { echo"<br>intervista: <b><font color=blue>$intervista</font></b>";}
if($inte!="") { echo"<br>intervista1: <b><font color=blue>$inte</font></b>";}
if($inter!="") { echo"<br>intervista2: <b><font color=blue>$inter</font></b>";}
if($interv!="") { echo"<br>intervista3: <b><font color=blue>$interv</font></b>";}
if($intervi!="") { echo"<br>intervista4: <b><font color=blue>$intervi</font></b>";}
if($intervis!="") { echo"<br>intervista5: <b><font color=blue>$intervis</font></b>";}
if($operatore!="") { echo"<br>operatore: <b><font color=blue>$operatore</font></b>";}
if($reporter!="") { echo"<br>reporter: <b><font color=blue>$reporter</font></b>";}
if($nastro!="") { echo"<br>nastro tipo: <b><font color=orange>$nastro</font></b>";}
if($n!="") { echo"numero: <b><font color=blue>$n</font></b>";}
if($na!="") { echo"/ <b><font color=blue>$na</font></b>";}
if($trak!="") { echo"traccia: <b><font color=blue>$trak</font></b>";}
if($tg!="") { echo"<br>edizione TG del: <b><font color=blue>$tg</font></b>";}
if($edizione!="") { echo"/ <b><font color=blue>$edizione</font></b> ";}
if($ore!="") { echo"<br>Time code: <b><font color=blue>$ore</font></b> ";}
if($minuti!="") { echo": <b><font color=blue>$minuti</font></b> ";}
if($secondi!="") { echo": <b><font color=blue>$secondi</font></b> ";}
if($frame!="") { echo": <b><font color=blue>$frame</font></b>";}
echo "<br><br>----------------------------<br><br>";
}
}
?>
</p></td>
</tr>
</table></td>
<td width="53"><table width="214" border="0">
<tr>
<td width="853" bgcolor="#999"><img src="back1.jpg" alt="" width="208" height="247" /></td>
</tr>
</table></td>
</tr>
</table>
[/php]hehhe, sono consapevolissimo che è un bordello allucinante, ma non mi è riuscito a fare di meglio! modifiche , snellimenti o altro sono ben accetti.
pensavo di fare il form di ricerca in una pag diversa da quella dello script php, ma così funziona.
Ricapitolando, le cose che vorrei aggiungere sono :
un sinstema che mi permetta di cercare un dato su 5 campi del db se viene seleziona la voce interviste!
e poi mi piacerebbe inserire u pulsante ( possibilmente a parte ) che mi stampasse l'ultimo record inserito.
grazie per ora!
PS: se volete vedere come funziona il tutto il link è info[dot]k6blue[dot]it[slash]A3