php - How to add data in database in codeigniter -


there 2 tables.

  1. category(idcategory,name,url)
  2. 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

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -