Advertisement
Guest User

update.php for Raven's StarDanks 1.4 patch

a guest
Jan 21st, 2014
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1. <?php
  2. include("inc/header.php");
  3.  
  4. $result = mysql_query("CREATE TABLE IF NOT EXISTS `news` (
  5.  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  6.  `title` varchar(100) NOT NULL,
  7.  `postedon` datetime NOT NULL,
  8.  `content` text NOT NULL,
  9.  PRIMARY KEY (`id`)
  10. ) ENGINE = MYISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
  11.  
  12. if($result) {
  13.     echo "News table successfully created. <br />";
  14.     $result = mysql_query("INSERT INTO `news` (`id`, `title`, `postedon`, `content`) VALUES
  15. (NULL, 'Welcome to StarDanks CMS!', NOW(), '<p>Thanks for installing StarDanks CMS, to modify the news, please login to the admin center.</p><p>You have successfully installed StarDanks CMS v0.1, bugs are to be expected. Please report them to the respective forum thread so they can be fixed!</p><p>Sincere Regards,</p><p>-Danks</p>');");
  16.     if($result) {
  17.         echo "Sample data inserted. Done!<br />";
  18.         echo "Click <a href=\"index.php\">here</a> to go to the home page.<br />";
  19.         echo unlink('update.php') ? "This file was deleted." : "No permisisons to delete the file. Please remove it manually!";
  20.     } else {
  21.         echo "Something went wrong...";
  22.     }
  23. } else {
  24.     echo "Something went wrong :(";
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement