Well, I have a database with support tickets, and would like to create a report of how many tickets a support tech has closed, and what their name is according to their userid.
I have written a query to return this:
Ticket ClientID Date Opened Status TechID Date Closed
1000 102 2003-10-22 23:12:37 -1 100 2004-07-11 22:35:49
The query below will give an idea of the table:
SELECT id, userid, priority, datesubmitted, status, assignedtoid, lastlog_datetime FROM troubleticket
The status of -1 equals the ticket is closed. A status of 1 is Open. What I'd like to do it total up the number of open tickets, and closed tickets per Tech Support user. There are numberous Tech support users. I would also like to substitute the output of the userid's with the actual name of the clients and tech support users which is in another table. Is this possible.
Or can I at least get the totals for now and work towards the names later?
I wrote a script that returns all the data in the table, but I can't figure out how to total the tickets per user.
Any help is appreciated as I am lost with arrays and more, advanced to me, PHP/Mysql.