2017-03-21, 15:36
So I didn't know a view runs the SQL that created it every time it's accessed (but it makes sense). What I ended up doing was modifying `global_tvshows` with another column called `viewers` that I populate with the values "UserA", "UserB" or "Both".
I dropped the `tvshows` for the particular user's database and recreated it with the SQL
User A will now only see shows where it's listed in the `global_tvshows`.`viewers` as "UserA" or "Both"
I dropped the `tvshows` for the particular user's database and recreated it with the SQL
PHP Code:
CREATE VIEW `tvshow` AS SELECT *
FROM `a_master_107`.`global_tvshow`
WHERE `viewers` = "UserA" OR `viewers` = "Both"
User A will now only see shows where it's listed in the `global_tvshows`.`viewers` as "UserA" or "Both"