There is a script
define('DB_HOST','localhost'); define('DB_USER','root'); define('DB_PASSWORD','root'); define('DB_NAME','test'); $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if ($link) { mysql_query('CREATE DATABASE IF NOT EXISTS '.DB_NAME, $link); } else { die('Could not connect: ' . mysql_error()); } // Make my_db the current database $db_selected = mysql_select_db(DB_NAME, $link); if ($db_selected) { // If we couldn't, then it either doesn't exist, or we can't see it. $sql = "CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nickname` varchar(256) NOT NULL, `password` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8"; $sql2 = "CREATE TABLE IF NOT EXISTS `categories` ( `id` int(255) NOT NULL AUTO_INCREMENT, `category_name` varchar(256) NOT NULL, `description` varchar(256) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; $result = $sql.$sql2; if(mysql_query($result, $link)){ echo "SUCCESS!"; } } mysql_close($link); One table is created and 2 unfortunately does not work.
;but at the end of the first one there is no, in theory, uvas there is generally a line written together in the togaCHARSET=utf8CREATE- teranmysqli/pdo- vp_arth