Automatic table join not working

Wappler 5.2
MacOS
PHP server
Mysql

I would like to bring the names of the departments not only the ids

Error
{
“code”: “42S22”,
“file”: “/var/www/html/dmxConnectLib/lib/db/Connection.php”,
“line”: 112,
“message”: “SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘usuario_piv_grupo_acesso.usuario_id’ in ‘where clause’”,
“trace”: “#0 /var/www/html/dmxConnectLib/lib/db/Connection.php(112): PDO->prepare(‘SELECT piv_gru...')\n#1 /var/www/html/dmxConnectLib/modules/dbconnector.php(372): lib\\db\\Connection->execute('SELECT piv_gru…’, Array)\n#2 /var/www/html/dmxConnectLib/modules/dbconnector.php(259): modules\dbconnector->processSubQueries(Object(lib\db\Connection), Array, Object(stdClass))\n#3 /var/www/html/dmxConnectLib/lib/App.php(197): modules\dbconnector->paged(Object(stdClass), ‘query’, Array)\n#4 /var/www/html/dmxConnectLib/lib/App.php(169): lib\App->execSteps(Object(stdClass))\n#5 /var/www/html/dmxConnectLib/lib/App.php(137): lib\App->execSteps(Array)\n#6 /var/www/html/dmxConnectLib/lib/App.php(126): lib\App->exec(Object(stdClass), false)\n#7 /var/www/html/dmxConnectLib/lib/App.php(104): lib\App->exec(Object(stdClass))\n#8 /var/www/html/dmxConnect/api/usuarios/admin/listar_usuarios.php(8): lib\App->define(Object(stdClass))\n#9 {main}”
}

Adriano, haven’t you reported the same here: Multi Reference . Issue with displaying related data ?

This may help:

good morning hello Teodor I hadn’t remembered this comment really sorry about that.
You can merge or leave this hidden please.

Thanks @ben but that’s not the case, the same thing happens using docker or from Sqlite

Hi, @Teodor and @patrick can this be resolved today?

The join condition is not correct, you can edit this yourself by clicking on the join table and then the edit button.

There will be no Wappler update the next 3 weeks because of holidays. Automatic table join only works if the references are defined in the database and will not work for all databases, we will see if it can be improved.

1 Like

@AdrianoLuiz
This update should fix the issue you are having:

Please test it and let us know if everything is fine.

1 Like