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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

ios - Possible to get UIButton sizeThatFits to work? -