Prefilter a list based on 2 tables

ontarget

Active Member
I have 2 tables
Profile table (aaa_my_profile) which records "userid" and the row "id"
Uploads table (aaa_file_uploads) which records the profile table id as a FK ("tfrs_app_id") and the user ID ("fu_userid" )

I need to prefilter all records that exist in the profile table that don't exist in the uploads table.

This works in phpMyAdmin
SELECT * FROM `aaa_my_profile` WHERE `id` NOT IN ( SELECT `tfrs_app_id` FROM `aaa_file_uploads` );
(124 records)
As does

SELECT * FROM `aaa_my_profile` WHERE `userid` NOT IN ( SELECT `fu_userid` FROM `aaa_file_uploads` );
(124 records)

How can I create a Prefilter query on the list using either of the select statements above.

I tried
Field
User id
Condition
Equals
Value
{$q->userid}
SELECT `userid` FROM `aaa_my_profile` WHERE `userid` NOT IN ( SELECT `fu_userid` FROM `aaa_file_uploads` );

This only returns 1 row.... But there should be 124 rows being returned.
Thanks for any suggestions!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top