I have two tables, the first one is USERS and the second one is TAGS.
this is the USERS table fields:
- ID
- NAME
and this is the TAGS table fields:
- PICTURE_ID
- USER_ID
now I want to count how much times one of the users is "taged" in the TAGS table (both based on the user_id but I want to be able to check according to the name).
example:
if I have the user
ID=1 NAME="aba"
and in the TAGS I have
PICTURE_ID=8 USER_ID=1,
PICTURE_ID=3 USER_ID=1.
so the number of times "aba" is taged in pictures is 2.