crudbooster
crudbooster copied to clipboard
How to make a join table in grid data with pgSQL?
$this->col[] = ["label"=>"División","name"=>"division_id","join"=>"divisiones,id"];
This line of code doesn't work in postgre, but in mysql it works.
$this->col[] = ["label"=>"División","name"=>"(select divisiones.divnombre from conceptos join divisiones on divisiones.id = conceptos.id_division and conceptos.id=
$id order by conceptos.id asc limit 1) as division"];
I have created a select query to display the divnombre field of the divisiones table, but I don't know how to get the id of the rows, it always returns ""
Does anyone know of a way to get and put the id of the concepts table in this query?
Also try with $row->id
I have tried assigning any value to conceptos.id=16, and has returned the value of the field, proving that the query could work