I know this question has been covered before I have read many answers and they all tell me how to write the SQL but not how to print out the results.
My dilemma is I have an orders table with a payment method field tha tlooks like this
OrderID OrderNumber PaymentMethod
1234 a1b2c3 PayPal
1235 a1b2c4 Account
1236 a1b2c5 Account
1237 a1b2c6 PayPal
1238 a1b2c7 Account
1239 a1b2c8 PayPal
1230 a1b2c9 PayPal
I need to print out something like
Number of PayPal payments: 4
Number of Account Payments: 3
I have tried to use this answer
MySQL: Count occurrences of distinct values
and I have this code
SELECT PaymentMethod,COUNT(*) as Payment FROM tablename GROUP BY PaymentMethod ORDER BY Payment DESC;
but how do I print this out?