I'm trying to select data from two mysql tables using Join but I'm wanting to select from several tables with similar names such as profile_starter, profile_advanced, profile_premium, etc. My question is how can I select from the other tables without having to join more tables? I've tried * but it doesn't work:
$inbox_sql = "
SELECT sender, recipient, time, message, viewed, name, avatar
FROM messages
LEFT JOIN profile_* ON profile_*.username = messages.sender
";
Please could you let me know if there's a solution to this? Thank you