Ciao a tutti, ho due tabelle, una con un elenco di progetti l'altra con un elenco di task.
Come posso creare un record che per ogni record inserito nella tabella progetti, venga creato un record nella tabella task con l'ID del progetto creato e come campo name il valore "Elenco Task"?
CREATE TABLE `projekte` (
`ID` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`desc` text NOT NULL,
`start` varchar(255) NOT NULL DEFAULT '',
`end` varchar(255) NOT NULL DEFAULT '',
`status` tinyint(1) NOT NULL DEFAULT '0',
`budget` float NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`),
KEY `status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
CREATE TABLE `tasklist` (
`ID` int(10) NOT NULL AUTO_INCREMENT,
`project` int(10) NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL DEFAULT '',
`desc` text NOT NULL,
`start` varchar(255) NOT NULL DEFAULT '',
`status` tinyint(1) NOT NULL DEFAULT '0',
`access` tinyint(4) NOT NULL DEFAULT '0',
`milestone` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`),
KEY `status` (`status`),
KEY `milestone` (`milestone`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
Grazie mille


Rispondi quotando