I have two tables containting user data. The first table has one record for every user. The second table can have 0 to multiple records per user depending on the programs they have access to.
I want to display every user and place a flag next to the ones that have access to the administration program. I use the query below and it sort of works.
SELECT investor_login.username, investor_login.firstname, investor_login.lastname, investor_login.status, investor_login.lastlogondate, investor_prg.program FROM investor_login LEFT JOIN investor_prg ON investor_login.username = investor_prg.username WHERE investor_login.investornumber = '$myinvestor' AND (investor_prg.program = 'admin.pl' OR investor_prg.program IS NULL) $order
This will give me a list of all users who have access to no programs or access to the admin program. However if someone has access to a program other than the admin one they are not selected.
Anyone have any ideas?
THanks
I want to display every user and place a flag next to the ones that have access to the administration program. I use the query below and it sort of works.
SELECT investor_login.username, investor_login.firstname, investor_login.lastname, investor_login.status, investor_login.lastlogondate, investor_prg.program FROM investor_login LEFT JOIN investor_prg ON investor_login.username = investor_prg.username WHERE investor_login.investornumber = '$myinvestor' AND (investor_prg.program = 'admin.pl' OR investor_prg.program IS NULL) $order
This will give me a list of all users who have access to no programs or access to the admin program. However if someone has access to a program other than the admin one they are not selected.
Anyone have any ideas?
THanks