Uppete
Il dubbione persiste ....................
Spiegamo la cosa ho una tabella TEST
(con primary key test_id) dove ho
una serie di domande.
Nella tabella test_results ho come
foreign key test_id.
In questo modo:
Codice PHP:
CREATE TABLE IF NOT EXISTS `test` (
`test_id` smallint(5) unsigned NOT NULL auto_increment,
`test_title` varchar(255) NOT NULL default '0',
`test_question1` varchar(255) NOT NULL default '0',
`test_question2` varchar(255) NOT NULL default '0',
-- etc ...........
PRIMARY KEY (`test_id`)
) ENGINE=MyISAM;
CREATE TABLE IF NOT EXISTS `test_results` (
`test_id` smallint(5) unsigned NOT NULL,
-- in test_result metto i risultati in questa forma
-- a,c,d,a, etc
`test_result` varchar(255) NOT NULL default '0',
FOREIGN KEY ( `test_id` ) REFERENCES test( `test_id` ) ON DELETE CASCADE
) ENGINE=MyISAM;
Può andare ?