I have access to a database similar to this:
id | name ====|======== 1 | Tom 2 | Dick 3 | Harry 4 | Sally
user_id | exclusion ========|============== 1 | French only 3 | No magazine 4 | English only 1 | No magazine
Is it possible to query the database to get a result like this?
$users = [ [ 'id' => 1, 'name' => 'Tom', 'english_only' => false, // unset or null would be okay 'french_only' => true, 'no_magazine' => true, ], // . . . ];
I've been playing around with things like
PIVOT, and other examples and can't figure out how or if any of it applies.