OK I though this would be easy enough but it aint I have set up a simple drop down form with a few options What I want to do is when someone selects an option and presses search (or go or what ever) results appear brought from my data bases and are displayed as a simple table Is there any script that will do this I thought this would be easy enough but I have been looking and cant find anything
Hy, Try adapt this code: <?php $tabel_html = ''; // here connect to mysql $val = 'value_to_search'; // here you must store the value from your form $cerereSQL = "SELECT * FROM `nume_tabel` WHERE `coloana`='$val'"; $rezultat = mysql_query($cerereSQL); if(mysql_num_rows($rezultat) > 0) { $tabel_html = '<table border="1">'; while($rand = mysql_fetch_array($rezultat)) { $tabel_html .= '<tr><td>' .$rand['col1']. '</td><td>' .$rand['col2']. '</td></tr>'; } $tabel_html .= '</table>'; } echo $tabel_html; ?> PHP: