<?
$host="localhost";
$username="----------";
$password="*******";
$db_name="kelvoron_testscripts";
$table_name="test1";
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tabLE_name WHERE gender='male'";
$result=mysql_query($sql);
while ($row = mysql_fetch_array($result)){
echo $row['name'];
}
mysql_close();
?>
Ok above is what i believe to be the simplest way to what you are trying to achieve. I changed SELECT name FROM to just SELECT * FROM because as you can see i am only selecting the name row. If you needed to output any other rows like you wanted to display the name then the gender you could put
echo $row['name']." - ".$row['gender'];
Hope that cleared things up a bit. I recommend reading here for further info
http://www.tizag.com/mysqlTutorial/mysqlfetcharray.php