I have tables with this structure.
table #1: users (ID, user_name)
1, 'john777'
2, 'andy'
3, 'tom'
table #2: user_meta (meta_ID, user_ID, 'meta_name', 'meta_value')
1, 1, 'first_name', 'John'
2, 1, 'last_name', 'Smith'
3, 2, 'first_name', 'Andy'
4, 2, 'last_name', 'Pete'
5, 3, 'first_name', 'Thomas'
6, 3, 'last_name', 'Tan'
7, 3, 'other_random_meta', 'abcxyz'
For you guys familiar with WordPress, this is their database structure. What I want to do is to get the user IDs of users matching my search term based on the user_name and full name, made up of first_name and last_name.
In other words, I want a search to return 1 for these search terms: 'joh', 'john7', 'smith', 'john smi', 'smith jo'