Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
crutchy
committed
Mar 21, 2015
1 parent
803a12b
commit 05cf3f0
Showing
9 changed files
with
180 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
CREATE TABLE `exec_irc_bot`.`sn_comments` ( | ||
`id` integer unsigned NOT NULL AUTO_INCREMENT, | ||
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`user` varchar(255) NOT NULL, | ||
`uid` varchar(255) NOT NULL, | ||
`score` varchar(255) NOT NULL, | ||
`score_num` varchar(255) NOT NULL, | ||
`subject` varchar(500) NOT NULL, | ||
`title` varchar(255) NOT NULL, | ||
`comment_body` varchar(3000) NOT NULL, | ||
`cid` varchar(255) NOT NULL, | ||
`sid` varchar(255) NOT NULL, | ||
`url` varchar(255) NOT NULL, | ||
`parent_cid` varchar(255) NOT NULL, | ||
`parent_url` varchar(500) NOT NULL, | ||
`story_url` varchar(500) NOT NULL, | ||
PRIMARY KEY (`id`), | ||
INDEX `timestamp` (`timestamp` ASC), | ||
INDEX `user` (`user` ASC), | ||
INDEX `uid` (`uid` ASC), | ||
INDEX `score` (`score` ASC), | ||
INDEX `score_num` (`score_num` ASC), | ||
INDEX `subject` (`subject` ASC), | ||
INDEX `title` (`title` ASC), | ||
INDEX `comment_body` (`comment_body` ASC), | ||
INDEX `cid` (`cid` ASC), | ||
INDEX `sid` (`sid` ASC), | ||
INDEX `parent_cid` (`parent_cid` ASC) | ||
) ENGINE=InnoDB AUTO_INCREMENT=1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
define("DB_HOST","localhost"); | ||
define("DB_USER","root"); | ||
define("DB_PASSWORD",trim(file_get_contents("../../../pwd/mysql_root_cs"))); | ||
|
||
$pdo=new PDO("mysql:host=".DB_HOST,DB_USER,DB_PASSWORD); | ||
if ($pdo===False) | ||
{ | ||
die("ERROR CONNECTING TO MYSQL SERVER\n"); | ||
} | ||
else | ||
{ | ||
echo "CONNECTED\n"; | ||
} | ||
$sql=file_get_contents("schema_comments.sql"); | ||
$result=$pdo->exec($sql); | ||
if ($result===False) | ||
{ | ||
die("ERROR CREATING DATABASE\n"); | ||
} | ||
else | ||
{ | ||
echo "DATABASE CREATED\n"; | ||
} | ||
$result=$pdo->exec("GRANT SELECT, INSERT, UPDATE, DELETE ON exec_irc_bot.* TO www@'%';"); | ||
if ($result===False) | ||
{ | ||
die("ERROR GRANTING PRIVILEGES\n"); | ||
} | ||
else | ||
{ | ||
die("PRIVILEGES GRANTED\n"); | ||
} | ||
|
||
?> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters