User data for dropdown

reinwarnke

New Member
I have a database join element displaying values from all of the registered users in a form. What I need is to display only the data belonging to the individual user, not the "registered" group. How do I accomplish this?

Thank you
 
I have one list with an equipment name which is entered by the user. The user also enters related data into another list which has the database join based on the equipment name. My site is based on only seeing the users specific information. I can get the list to display only the user information. The users are in the "Registered" group. However in a form the dropdown shows all the information in the table/list and does not limit itself to just the users data.
For what it's worth, a user can enter a number of equipment names, each with a record in the list. The second list can have multiple entries for each equipment name. When it is displayed as a list the "userid" field works to limit the data to the users information, but when I go to a form to add information to the second table that is where everyone's data shows up in the dorpdown.
Rein
 
Note that Troester's where clause will work if the person filling out the form is the "owner", because it uses the {$my->id} placeholder, which gets replaced with the userid of the logged on user.

But if someone else is editing another user's form, like (say) an admin is correcting something on someone else's form(s), then that will filter to the "wrong" data. It will filter to the admin's equipment, not the person who's form they are editing.

The way round that is to have a 'user' element on both tables, so you can use {tablename___userid} instead of {$my->id}, where tablename___userid is the full element name of the user element on the form the join is part of.

NOTE - having said that, this assumes I have fixed a little gotcha, whereby when creating a new form, the 'userid' element didn't have a value. So if using this method doesn't work on new forms, let me know, as its something that should be fixed. I'm pretty sure I did fix this a while back, but sometimes I only imagine I fixed things, I never actually got round to doing it, LOL!

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

Thank you.

Members online

No members online now.
Back
Top