

set_relation problem
#1
Posted 20 April 2012 - 04: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, parametros.descripcion as 'parametros.descripcion' 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?
#2
Posted 20 April 2012 - 08:33 PM
#3
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...
#4
Posted 04 May 2012 - 06:42 PM
Any ideas???
#5
Posted 04 May 2012 - 07:22 PM
gives the same sql error...
#6
Posted 04 May 2012 - 11:09 PM

#7
Posted 04 May 2012 - 11: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 =)
#8
Posted 04 May 2012 - 11:35 PM


#9
Posted 04 May 2012 - 11:49 PM
#10
Posted 07 May 2012 - 01:16 PM
#11
Posted 07 May 2012 - 03: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!!
#12
Posted 07 May 2012 - 10:48 PM


0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users