Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Created by Cooldude170
- while (1) {
- function installDB()
- {
- echo "What is the DB host?\n";
- $host = trim(fgets(STDIN));
- echo "What is the DB username?\n";
- $user = trim(fgets(STDIN));
- echo "What is the DB password?\n";
- $pass = trim(fgets(STDIN));
- echo "What is the DB name?\n";
- $name = trim(fgets(STDIN));
- mysql_connect($host, $user, $pass) or die(mysql_error());
- mysql_select_db($name) or die(mysql_error());
- echo "Successfully established MySQL connection to database " . $name . " on host " . $host . "!\n";
- echo "Uploading the tables to the database, please wait a moment...\n";
- $accs = "CREATE TABLE IF NOT EXISTS `accs` (
- `ID` int(11) NOT NULL AUTO_INCREMENT,
- `name` text NOT NULL COMMENT 'Nickname',
- `crumbs` text NOT NULL COMMENT 'User Crumbs',
- `password` text NOT NULL COMMENT 'MD5 Password',
- PRIMARY KEY (`ID`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
- ";
- $redemption = "CREATE TABLE IF NOT EXISTS `redemption` (
- `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Index',
- `Type` text NOT NULL COMMENT 'Type',
- `Code` text NOT NULL,
- `Items` text NOT NULL,
- `Coins` int(11) NOT NULL DEFAULT '0',
- `Expire` int(11) NOT NULL DEFAULT '0' COMMENT 'Unix expire date',
- `Uses` int(11) NOT NULL DEFAULT '1',
- PRIMARY KEY (`ID`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Redemption Server Data' AUTO_INCREMENT=1 ;";
- $stats = "CREATE TABLE IF NOT EXISTS `stats` (
- `ID` int(11) NOT NULL COMMENT 'Server ID',
- `population` int(11) NOT NULL COMMENT 'Population',
- `ts` text NOT NULL COMMENT 'Timestamp',
- UNIQUE KEY `ID` (`ID`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
- mysql_query($accs) or die(mysql_error());
- mysql_query($redemption) or die(mysql_error());
- mysql_query($stats) or die(mysql_error());
- echo "Done. Thank you for using iCPPS Installer created by Cooldude170!\n";
- sleep(5);
- }
- installDB();
- }
Add Comment
Please, Sign In to add comment