MySQL - Return number of rows matching query data?
- by Keir Simmons
I have a query as follows:
SELECT 1 FROM shop_inventory a JOIN shop_items b ON b.id=a.iid AND b.szbid=3362169 AND b.cid=a.cid WHERE a.cid=1 GROUP BY a.bought
The only thing I need to do with this data is work out the number of rows returned (which I could do with mysqli -> num_rows;. However, I would like to know if there is a method to return the number of rows that match the query, without having to run num_rows?
For example, the query should return one row, with one result, number_of_rows.
I hope this makes sense!