I have got a website built on wordpress and would like to create a SQL query for displaying users points by their username.
Points in the table linked to users IDs and not to usernames. My SQL query is:
SELECT ID
FROM wp_users
WHERE user_login='{username}'
SELECT points
FROM wp_cp
WHERE uid=ID
Which is wrong. Separately they work fine but how can I make only one SQL query?
The logic should be by typing username - SQL gets its ID from wp_users and automatically points number from wp_cp by matching users ID.
Can anyone please help me with this problem? Thank you.