php - How to add data in database in codeigniter -
there 2 tables.
- category(idcategory,name,url)
- subcategory(id,name,url,idcategory)
in codeigniter have controller named submenu , view vwsubmenu. in add function have add name, url , idcategory subcategory table.but in view page there 3 field 1 input type text(name),input type text(url),select type name of category category table.
now want take id of category table name (which input of select type)and insert subcategory table in idcategory field. how in codeigniter.
please help
first improve database structure.
create table if not exists `category` ( `idcategory` int(11) not null auto_increment, `parent_id` int(11) not null, `name` varchar(255) not null, `url` varchar(255) not null, primary key (`idcategory`) ) engine=innodb default charset=latin1 auto_increment=8 ;
try ...
http://forum.codeigniter.com/archive/index.php?thread-493.html
Comments
Post a Comment