By the by, if you forget to give a name to the foreign key, MySQL gives it one for you.
You can find out the name it used by doing
SHOW CREATE TABLE product_images;
(or whatever the table name is).
For example, using the SQL you gave in your prior posting, this is what I got via SHOW CREATE TABLE:
CREATE TABLE `product_images` (
`imgID` int(11) NOT NULL AUTO_INCREMENT,
`productID` int(11) DEFAULT NULL,
`imgName` varchar(50) DEFAULT NULL,
PRIMARY KEY (`imgID`),
KEY `productID` (`productID`),
CONSTRAINT `product_images_ibfk_1` FOREIGN KEY (`productID`) REFERENCES `products` (`productid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
Notice how all the defaults you did *NOT* specify (e.g., "NULL" and "CHARSET") are chosen for you as well and then shown via this command.