I have a table called horses, with current data as follows: http://www.virtualstudbook.co.uk/images … _table.jpg
I would like to have a list of the breeds for each gender, showing how many results there are, i.e,
Abaco Barb (3)
Belgian Draft Horse (1)
mysql_connect(“", "”, “") or die(mysql_error());
mysql_select_db("”) or die(mysql_error());
$data = mysql_query("SELECT gender, COUNT(*) SELECT * FROM `horses` WHERE gender = 'mare' AND allowed='OK' GROUP BY breed;") or die(mysql_error()); ?>
The end result is a blank page. Could someone advise me where I am going wrong? I plan on turning the breed names into links, is there a better way of doing this? I plan on producing a second table with breed name, gender and url.