0
I am working with small relationships and I realized that in a state table in which I related the field id
the table país[id]
I get this error message or alert, I’m not sure. Already in a table relationship cidade
the table estado[id]
I don’t have this mistake.
Can help me to know why this error occurs in the relationship estado - país?
My SQL is this:
$criar = "CREATE TABLE IF NOT EXISTS $aonde.$tablee (
id INT(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT,
nome VARCHAR(75) DEFAULT NULL,
uf VARCHAR(5) DEFAULT NULL,
pais INT(6) UNSIGNED ZEROFILL DEFAULT NULL,
PRIMARY KEY (id), KEY fk_Estado_pais (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=28";
think q vc has to set the fk_Estado_parents ... type in mysql would be : Foreign key(parents) References fk_Estado_parents(id).
– Pedro Rangel