I'm going to prepare an installation script for my website which is automatically creates database and it's tables. How can I send every queries in one? Here is the PHP code:
$table_query = "CREATE TABLE IF NOT EXISTS ".TP."_usertypes(
utid INT(11) NOT NULL AUTO_INCREMENT,PRIMARY KEY (utid),
utname VARCHAR(255)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci;
CREATE TABLE IF NOT EXISTS ".TP."_users(
uid INT(11) NOT NULL AUTO_INCREMENT,PRIMARY KEY (uid),
utid INT(11) NOT NULL,FOREIGN KEY (utid) REFERENCES ".TP."_usertypes(utid) ON DELETE RESTRICT,
username VARCHAR(255),
password VARCHAR(255),
avatar VARCHAR(255)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci";
mysqli_query($connection,$table_query) or die(mysqli_error($connection));
Thank you.