Search code examples
phpsqlphpbb

How to find phpBB user that has custom field equal to '1234'?


I have a phpBB installation. I've added custom profile field called 'insurance number'. Every user has different value there. I would like to get a user that has the value equal to '1234'.

How to get a user by the custom field?


Solution

  • First do:

    SELECT * FROM phpbb_users LIMIT 1
    

    To check the name of the custom field. It could be insurancenumber, insurance_number etc.

    A query like this will select your data:

    SELECT  u.user_id, u.username
    FROM  phbb_users u
    INNER JOIN phbb_profile_fields_data pf ON u.users_id = pf.users_id
    WHERE u.`insurance number` = '1234'