JA
Cadastro escolhendo vários registros de outra tabela
Fechado
Como fazer uma tela que ao cadastrar o grupo eu posso povoar a tabela item_grupo com varias unidades, conforme a tela exemplo :
SET foreign_key_checks = 0;
CREATE TABLE grupo (
id integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
descricao varchar(100),
imovel_id integer not null);
CREATE TABLE item_grupo (
id integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
grupo_id integer not null,
unidade_id integer not null);
ALTER TABLE `gestor2016`.`item_grupo`
ADD INDEX `fk_item_grupo_grupo_idx` (`grupo_id` ASC);
ALTER TABLE `gestor2016`.`item_grupo`
ADD CONSTRAINT `fk_item_grupo_grupo`
FOREIGN KEY (`grupo_id`)
REFERENCES `gestor2016`.`grupo` (`id`)
ON DELETE CASCADE
ON UPDATE CASCADE;
SET foreign_key_checks = 0;
CREATE TABLE grupo (
id integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
descricao varchar(100),
imovel_id integer not null);
CREATE TABLE item_grupo (
id integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
grupo_id integer not null,
unidade_id integer not null);
ALTER TABLE `gestor2016`.`item_grupo`
ADD INDEX `fk_item_grupo_grupo_idx` (`grupo_id` ASC);
ALTER TABLE `gestor2016`.`item_grupo`
ADD CONSTRAINT `fk_item_grupo_grupo`
FOREIGN KEY (`grupo_id`)
REFERENCES `gestor2016`.`grupo` (`id`)
ON DELETE CASCADE
ON UPDATE CASCADE;
Júnior acredito que esse exemplo pode lhe auxiliar na sua problemática.
www.adianti.com.br/framework_files/tutor/index.php?class=CheckoutFor