First off, I have little experience with either php or mysql. I have 2 tables inside mysql database running under wordpress. table 1 is 'wp_rebate' with stores users account data table 2 is 'wp_users' which is default table wordpress uses to store username/pass etc.
I am trying to output the wp_rebate table for each specific logged in user and this query doesnt seem to be working?
SQL Query:
SELECT *
FROM
wp_rebate
JOIN
wp_users
ON
wp_rebate.user_name=wp_users.user_login
WHERE
wp_users.user_login= '$username';
Do I have to add some PHP code to the page thats calling the data table?