Databasejoin pre-filter dopdown for user

aaronpie

New Member
I am using a form to have my users upload information about their websites. This form also collects their Joomla id. I have also created another form for my users to upload photos that they want to use on their websites.

I have a database join between the two tables that uses the id of the website table, but labeled with the domain name field from this table.

When the user goes to add photos to the form and they select the domain name from the database join dropdown element, they are given a choice of all the domains for all my users. I would like the dropdown to show only the domains for that logged in user. How do I pre-filter the database join dropdown list.
 
When they go to upload photos, filter the domains so that you only show websites 'where user = current user' by using the Joins WHERE option...
 
That would be ...

WHERE {thistable}.userid = {$my->id}

... in the join's WHERE filter.

Just replace userid with whatever the field name it is that stores your user ID.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top