Page 1 of 1

Whats worng with this? keeps showing no data

Posted: 2022-06-22 17:06
by arcanebits
This is the sql of a lookup field
***************
SELECT `Provincia`.`id`, `Provincia`.`Provincia` FROM `Provincia`
WHERE `Provincia`.`pais` = `Usuario.`Pais` ORDER BY 2
***************
`Usuario.`Pais` its also a lookup field. thats seeks into a pais db get the name and done.

Any help is more than welcome.
a3

Re: Whats worng with this? keeps showing no data

Posted: 2022-06-22 17:28
by jsetzer
(1) There is a quote missing here:

Code: Select all

WHERE `Provincia`.`pais` = `Usuario.`Pais`
(2) Table `Usuario` is not known. If there is a relation between `Provincia' table and `Usuario` table you need to join that second table

Re: Whats worng with this? keeps showing no data

Posted: 2022-06-24 14:32
by arcanebits
Thanks a lot Jsetzer you have a quite sharp eye! thank I fixed the first mistake. In the try of fix the second i read some mysql and trired my best, the end result is not as expected.
What im trying to accomplish its to make the usual data gathering based on geopolitical divisions, as Country>State>County. Where the User DB gets the country of CountryDB via lookup, then the State is another lookup based on your previous CountryLooup and so on... so I have CountryDB StateDB CountyDb....
I can only get to work the first lookup (country) from there I get weirds results.
I have attached a image showing the web image with the two querrys i have tried after some reading.
Any tip is more than welcome.
a3

Re: Whats worng with this? keeps showing no data

Posted: 2022-06-25 14:33
by arcanebits
It seems that what i was triying to achieve was OVERKILL and AppGini, no code requied had a solution... and its this.
https://www.youtube.com/watch?v=ySABQLupBRs&t=52s

Thanks to Jsetzer who is truly an AppGini Hero!