crudbooster icon indicating copy to clipboard operation
crudbooster copied to clipboard

How to make a join table in grid data with pgSQL?

Open pirevai opened this issue 2 years ago • 1 comments

$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

pirevai avatar Jun 30 '22 11:06 pirevai

I have tried assigning any value to conceptos.id=16, and has returned the value of the field, proving that the query could work

pirevai avatar Jun 30 '22 12:06 pirevai