php - How to use dbforge[of codeigniter] to add foreign key -
i using codeigniter , trying convert following query dbforge style query, how can it?
create table filter ( filterid int primary key auto_increment, filtername varchar(50) not null, categoryid int not null, isactive tinyint not null, sequence int not null, foreign key(categoryid) references category(id));
use $this->db->query();
instead.
this works me....
$sql="create table filter ( filterid int primary key auto_increment, filtername varchar(50) not null, categoryid int not null, isactive tinyint not null, sequence int not null, foreign key(categoryid) references category(id))"; $this->db->query($sql);
Comments
Post a Comment