mySQL Foreign key that will not be constrained
I realize that linuxquestions might be the wrong place to ask this question but I will try anyway.
I am making a simple database that will be populated with data from a perl script. The tables are created and they work fine unless for one thing. I can create rows in the url table with nickids that does not exist in people even though I use the constraint attribute. Anyone have an ide why this is so?
*edit* I pasted a new version of the original code that will not be lost after a couple of days *edit*
PS, I wrote this by hand so there might be writing errors in the code.
I just found the solution together with some of my classmates. It seems mySQL does not support foreign keys by default so you have to use innodb. You do that by adding the line ENGINE=InnoDB at the end of each table creation.
Here is a complete copy of the changes.
|All times are GMT -5. The time now is 03:40 AM.|