problem concat label

louis037

Member
Hello everyone!
My problem is : I have a form stored in a database "data_trainings" with a database join in multi select to select companies from my database "data_companies". (the id of companies is stored in a repeat database "data_trainings_repeat_training_place") I have another form in which I will select those companies. So, in concat label I tryed these code:
Code:
(SELECT DISTINCT company_sign FROM data_trainings_repeat_training_place, {thistable}, data_companies WHERE data_companies.id = data_trainings_repeat_training_place.training_place AND data_trainings_repeat_training_place.parent_id = {thistable}.id),' ',{thistable}.training_title_action
My code shows an error...
When I do these query in mysql :
Code:
SELECT DISTINCT
    data_companies.company_sign
FROM
    data_trainings_repeat_training_place,
    data_trainings,
    data_companies
WHERE
    data_companies.id = data_trainings_repeat_training_place.training_place
    AND data_trainings_repeat_training_place.parent_id = data_trainings.id
all is OK... Why?

Thank you for helping me!!!
 
What error is it throwing?

The only difference I see is that you are fully qualifying the selected field in your test, data_companies.company_sign, but not in the CONCAT query. So if that field name exists in any of the other selected tables, it'll complain about ambiguous field names.

-- hugh
 
Thois code works perfectly, BUT :
Code:
(SELECT DISTINCT training_place FROM data_trainings_repeat_training_place WHERE data_trainings_repeat_training_place.parent_id = {thistable}.id),' ',{thistable}.training_title_action
shows only the id of the company. The field for the company name is located in "data_companies" and the table data_trainings_repeat_training_place.training_place has the id of the company, parent_is shows the id of data_trainings of course.
What I'm trying to do is show the name of the company from the database 'data_companies', companies selected (multi select) in form "data_trainings" and saved to the repeat table.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top