Filtering 2 Columns

Guys

I have now got over the issues I have had and it is full steam ahead :)

I am just in the process of building a form which allows my subscribers to create a maintenance job. I have started with the following setup and this is what I want to do.

I have a db join element that is hidden and is pulling all contractors who do electrics with a WHERE clause and an AND clause to filter those by my user id

WHERE {thistable}.contract_trades = 'electric' AND {thistable}.contract_userID = {$my->id}

I then have a cdd element that is displaying the contractors that belong to me but it is only displaying one entry.

I have tried putting a WHERE clause in the CDD as opposed to the AND clause in the DB Join but it still does not work

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

Can someone please help with this?

Thanks
 
Not quite sure what you want to display with your CCD (additional entries?).
You can't use WHERE (the query contains already a WHERE part), all from the "WHERE query" field is appended with AND.

I have a CCD where I want to show the watched entries (org_id={$my->id} + some additional entries and have done this with

1=1 OR {thistable}.org_id=73 order by xxx
which will create the query
WHERE org_id = '75' AND 1=1 OR efilialen.org_id=73 order by xxx
 
Thanks Troester - Sorry its probably not clear

I am filtering the contractors trade in the db join element, so in the example above I want to filter electricians (electric being in the trade column)

WHERE {thistable}.contract_trades = 'electric'

But I only want to show the electricians that I have added

I am probably over complicating this so how can I simply display the tradesman I have added with a trade of electric

Table name is: contractors
Trade Column: contract_trades
Name of tradesman column: contract_name
User ID: contract_userID

Thanks for your help once again

Regards
 
Done It!!!

I have applied this to the db join and it displays electricians only (Scrapped the CDD)

WHERE {thistable}.contract_userID = {$my->id} AND {thistable}.contract_trades = 'electric'
Thanks for your help
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top