Hello,
Here is my question.
I have a file called rock.php and here is the code so I don't have to explain myself. 😃
<?php
$con = mysql_connect("localhost","user","admin");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("admin16", $con);
$result = mysql_query("SELECT * FROM artista WHERE genre='Rock'");
$num_rows = mysql_num_rows($result);
print "<font color='#990000' FACE='Tahoma' FONT-SIZE:'11px'>There are $num_rows records.</font><P>";
while($row = mysql_fetch_array($result))
{
print "Artista: ";
echo $row['artista'];
echo "<br />";
print "Contacto: ";
echo $row['contacto'];
echo "<br />";
print "Oficina: ";
echo $row['oficina'];
echo "<br />";
print "Celular: ";
echo $row['celular'];
echo "<br />";
print "Direccion: ";
echo $row['direccion'];
echo "<br />";
print "Pagina Web: ";
echo $row['paginaweb'];
echo "<br />";
print "E-mail: ";
echo $row['email'];
echo "<br />";
print "Genero: ";
echo $row['genero'];
echo "<br /><br />";
}
mysql_close($con);
?>
What the above does is that it matches any results having the genre as ROCK in the database.
Now I have the following HTML with a list/menu:
<form name="form1" method="post" action="">
<label><br>
Genero
<select name="select">
<option>Rock</option>
<option>Pop</option>
<option>Alternativo</option>
<option>Electronico</option>
<option>Salsa</option>
</select>
</label>
<br>
<br>
<label>
<input type="submit" name="Submit" value="search">
</label>
</form>
How can I do that when someone selects the Rock option and clicks on the search do display the results on this html page?
Thanks.
MOD EDIT: PHP bbcode tags substituted in for CODE tags; please use these in the future when posting PHP code. Thanks!