Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $srvname="localhost";
- $username="root";
- $passwd="P@ssw0rd";
- $dbname="testdb";
- //Массив с именами файлов таблиц ACL, совпадают с именами таблиц в БД
- $acl_tables = array(1 => 'acl_esx_rules','acl_exim_rules','acl_ftp_rules','acl_loader_rules','acl_motorsich_6116_rules','acl_motorsich_oracle_rules','acl_motorsich_rdp_rules','acl_pib_rules','acl_printera_rules','acl_prohod_rules','acl_sharepoint_user_rules','acl_spfserv_rules','acl_squid_rules','acl_tender_rules','acl_terminet_rules');
- mysql_connect($srvname, $username, $passwd) or die (mysql_error ());
- mysql_select_db($dbname) or die(mysql_error());
- echo "Using DB ".$dbname. "<br />";
- for ($i = 1; $i <= count($acl_tables); $i++)
- {
- echo "Create table ".$acl_tables[$i]."<br /> ";
- $trunk = "CREATE TABLE `testdb`.$acl_tables[$i] ( `id` INT NOT NULL AUTO_INCREMENT , `ip_addr` VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `username` VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB";
- mysql_query($trunk) or die(mysql_error());
- }
- mysql_close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement