set_relation problem
- Single Page
Posted 20 April 2012 - 16:46 PM
when I set the relation $crud->set_relation('id_tipo','tipos_parametros','descripcion');
I get a DB error.
ERROR: syntax error at or near "'parametros.descripcion'" LINE 1: ...scripcion as sb55f4aee, parametros.descripcion as 'parametro... ^
SELECT parametros.*, jb55f4aee.descripcion as sb55f4aee[b], parametros.descripcion as 'parametros.descripcion'[/b] FROM "parametros" LEFT JOIN "tipos_parametros" as jb55f4aee ON "jb55f4aee"."id_tipo" = "parametros"."id_tipo" LIMIT 10
the string in bold, it should be there If I remove the query is correct.
web-johnny can you help me here?
Posted 20 April 2012 - 20:33 PM
Posted 22 April 2012 - 02:20 AM
Tried to set a a relation and got a DB error. Dropped the table and recreated exactly the same and then it worked...
Posted 04 May 2012 - 18:42 PM
Any ideas???
Posted 04 May 2012 - 19:22 PM
gives the same sql error...
Posted 04 May 2012 - 23:09 PM
Posted 04 May 2012 - 23:27 PM
CREATE TABLE detalle_zonas
(
id_detzona integer NOT NULL DEFAULT nextval('sec_id_detzona'::regclass),
nombre character varying,
descripcion character varying,
usuario character varying,
fecha_creacion timestamp without time zone DEFAULT now(),
fecha_mod timestamp without time zone,
codigo_comuna integer
)
CREATE UNIQUE INDEX pkdetalle_zona
ON detalle_zonas
USING btree
(id_detzona );
CREATE TABLE geo_comunas
(
codigo_region integer,
codigo_provincia integer,
nombre character varying,
codigo_comuna integer
)
CREATE UNIQUE INDEX pk_asdasd
ON geo_comunas
USING btree
(codigo_comuna );
$crud->set_table('detalle_zonas2');
$crud->columns('nombre','descripcion','usuario','fecha_creacion','codigo_comuna');
$crud->display_as('codigo_comuna','Comuna');
$crud->set_relation('codigo_comuna','geo_comunas','nombre');
please help =)
Posted 04 May 2012 - 23:35 PM
Posted 04 May 2012 - 23:49 PM
Posted 07 May 2012 - 13:16 PM
Posted 07 May 2012 - 15:50 PM
if($this->field_exists($related_field_title)){
$select .= ", {$this->table_name}.$related_field_title as '{$this->table_name}.$related_field_title' ";
}
changed to:
if($this->field_exists($related_field_title)){
$select .= ", {$this->table_name}.$related_field_title as \"{$this->table_name}.$related_field_title\"";
}
Thanks for your consern =)
I'm fixing this issues for a postgres version maybe you should add in the future.
Great Work!!
Posted 07 May 2012 - 22:48 PM