I am trying to create a database with two tables: Location and UserProfile.
Location contains addresses, and UserProfile contains HowtownLocation and CurrentLocation.
I want Hometownlocation and Currentlocation to contain IDs from Location, and cascade when a user is deleted (assuming more than one user does not share the same address).
One user can have multiple addresses (i.e Hometown and Current), and one address can be used by many users.
I have a sort-of working version, but I still need it to cascade changes… and I want to be able to input data into it in PHPMyAdmin by creating a new UserProfile.
I am using MySQL Workbench, but that is not important.
🙂
MySQL Reference helps. The Syntax is:
Also make sure that your database is not MyISAM, but InnoDB which is the default in newer MySQL versions as far as i know.