[SOLVED] HELP! How put a value in a field from an other field?

Status
Not open for further replies.

F.schettino

Italian
Please, help a novice.
I don't understand where is the manual; can someone give me the link, please?


Question 1
I have a Table ("Comuni-Province-Regioni") with fields:
id | Municipatily | Province | Region
and a form in wich user have to insert Name-First Name- .... Municipatily-Province-Region ......

So, if user insert a Municipatily in the form, it is possible set (or only show) the corrisponding Province and Region.

I was able to get a list of Municipatily, Province and Region (using databasejoin plug-in and Table ) but I don't know how set (or show) automaticly Province and Region.
I tryed to put
where 'comune'={thistable}.comune
in
  • Joins clausule WHERE e/o ORDER BY (SQL)
but it caused an error during execution:
  • You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select 'nominativi.provincia' from 'nominativi' where 'comune'=Comuni-Province-R' at line 3 SQL=SELECT DISTINCT(`Comuni-Province-Regioni_1`.`Provincia`) AS value, `Provincia` AS text FROM `Comuni-Province-Regioni` AS `Comuni-Province-Regioni_1` WHERE select 'nominativi.provincia' from 'nominativi' where 'comune'=Comuni-Province-Regioni_1.comune ORDER BY text ASC

Question 2 (general question)
How can set the field to get than user choose from the list of Municipatily (text), but save its id (and show Municipatily, obviously)?


Thank you for your help.
 
The wiki contains the documentation: http://www.fabrikar.com/forums/index.php?wiki/index/
Tutorials are helpful as well all though some are based on older versions: http://fabrikar.com/help/tutorials

I think you are on the right track using the database join element: http://fabrikar.com/forums/index.php?wiki/database-join-element/

The database join will display your label but save the id of the selected record. So, to automatically show Municipality, Province, and Region all together as a label, you would use a custom Concat label something like this:

{thistable}.comuni, ' - ', {thistable}.province, ', ', {thistable}.regioni
 
Thank you for your replay, faster then light :)

I am going to read and hope to get information I need.
(Sorry for my bad English...) :(
 
I tried all but I was not able to get what I need.

1- I tried

S1a.png
and I got an error:
S1b.png
OK, is ambiguous.

2- I tried
S2a.png

but it caused an error:
S2b.png

3- I also tried
S3a.png


An other error:
S3b.png


I don't understand... :(
 
No 2 is the correct syntax.
But it seems Fabrik is not quoting (back ticks) table names in the concat (and this is breaking if the tablename contains "-", better don't use such names).
So try
`{thistable}`.xxx
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top