Show values from other tables

Good
Let's see if you can help me… or give me some ideas, so I can investigate…
I have 3 tables with their respective elements
TABLE A
TABLE C
TABLE B

I would like Table C to show some data from Table A and Table B.

the first data in table C ... I take it using a databasejoin that points to table A

I tested on element ‘CALC’ in table C to show the value of an element in table B…
$ myCalc = '{tableB___element1_raw}';
return $ myCalc;

thank you
 
You can join List A and B to your List C.
https://fabrikar.com/forums/index.php?wiki/list-joins/

And with calc elements, you cannot use element placeholders to retreive data from other tables unless these other tables are joined to the current table. Without joining you can get data from other tables with a sql query in calc element.
https://fabrikar.com/forums/index.php?wiki/php-common-tasks/
thanks for the help and speed !!!!
I try to review the threads you propose to me.
if I have any questions ... I'll comment.
 
You can join List A and B to your List C.
https://fabrikar.com/forums/index.php?wiki/list-joins/

And with calc elements, you cannot use element placeholders to retreive data from other tables unless these other tables are joined to the current table. Without joining you can get data from other tables with a sql query in calc element.
https://fabrikar.com/forums/index.php?wiki/php-common-tasks/
a question ...
What would be the best option… to show in TABLE C (RISKS) only a data from table B
Considering that in table B there is an element (databasejoin)
I have a hard time understanding and interpreting the "join" and I would like to go for "calc"
thank you ...
 

Attachments

  • calc fabrik.jpg
    calc fabrik.jpg
    107 KB · Views: 64
Your join would be from Table C "progeso_element_name" to Table B "id" assuming your databasejoin element "value" option is set to id [recommended].

To get Riesgo value in Table C with calc element you should have something like:
PHP:
$mydb = JFactory::getDBO();
$mydb->setQuery("SELECT riesgo_element_name FROM table_b WHERE id = '{table_c___progeso_element_name_raw}' ");
return $mydb->loadResult();

This is not tested, so you may need to adjust. And of course change the table/element names to match yours.
 
thank you very much for your answer ...
I keep researching and learning ...
great !!:);):)
I try and comment to see if I'm right.:rolleyes:
 
Good again.
I've tried with
$ mydb = JFactory :: getDBO ();
$ mydb-> setQuery ("SELECT risk_element_name FROM table_b WHERE id = '{table_c___progeso_element_name_raw}'");
return $ mydb-> loadResult ();


and perfect !!:););):)
with the JOIN I didn't know ... but with the CALC option ... it's worth it.
I'm going to try with a third table..which contains repeated elements.

I have come to the conclusion that my knowledge is somewhat limited, but I am grateful that I will get an answer and I am grateful for the patience and dedication you give me.

thank you very much
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top