Skip to content

Instantly share code, notes, and snippets.

@tonyvich
Created March 22, 2020 07:56
Show Gist options
  • Save tonyvich/b81643b63cb4d228f8947919e349b656 to your computer and use it in GitHub Desktop.
Save tonyvich/b81643b63cb4d228f8947919e349b656 to your computer and use it in GitHub Desktop.
Database Definition Select Autopopulate php tutorial
CREATE TABLE countries (
country_id INT AUTO_INCREMENT PRIMARY KEY,
country_name VARCHAR(255),
country_code VARCHAR(3)
);
CREATE TABLE towns (
town_id INT AUTO_INCREMENT PRIMARY KEY,
town_name VARCHAR(255),
country_code VARCHAR(3) /* The country of the current town */
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment