this is my db(salelist)
id type firstname mob affid salestatus
1 refund nike **** 5443 cancelled
2 sale bob **** 5443 ok
3 sale mike **** 5123 ok
4 sale john **** 5443 ok
5 refund cat **** 5443 cancelled
6 sale mony **** 5443 ok
7 refund ity **** 5123 cancelled
i want to sort and count how many sale and refund get to each affiliate
i want result like this in a table
affid sale refund
5443 3 2
5123 1 1
please help to find out
this is my code mycode
i got this error while running mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\SANN\check\affiliateslist.php on line 23