I have this MYSQL (phpmydamin) database table that looks like this, and I'm trying to retrieve information on the values greater than 1 for a specific row as well as the column names corresponding with those set values. I'm basically trying to find out what item is held by a student and how many.
username item1 item2 item3 item4 item5 item6 item7
n000111 1 0 1 1 1 1 1
n010554 0 0 3 2 0 0 0
n010555 1 0 4 0 0 1 1
n010556 0 0 0 0 0 0 0
n010557 0 8 0 2 0 1 0
So for example, if i'm sending the username "n010555", to my phpscript to fetch data from this table, I'm expecting feedback like:
n010555
item1 - 1
item3 - 4
item6 - 1
item7 - 1
total - 7
Something like that, I'll really appreciate the help. Thanks in advance.