Login   Register  
PHP Classes
elePHPant
Icontem

File: sql/queries.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Bogdan Lupandin  >  Installation Automation  >  sql/queries.php  >  Download  
File: sql/queries.php
Role: Example script
Content type: text/plain
Description: The SQL queries example script
Class: Installation Automation
Automate multi-step application installations
Author: By
Last change:
Date: 5 years ago
Size: 10,252 bytes
 

Contents

Class file image Download
<?php

$create = array("CREATE TABLE IF NOT EXISTS `audio` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `comments` varchar(255) NOT NULL,
  `views` varchar(255) NOT NULL,
  `allowComments` varchar(255) NOT NULL,
  `lastViewed` varchar(255) NOT NULL,
  `url` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1",

"CREATE TABLE IF NOT EXISTS `forum_a` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `sub_id` varchar(255) NOT NULL,
  `q_id` varchar(255) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `poster` varchar(255) NOT NULL,
  `body` varchar(255) NOT NULL,
  `date` varchar(255) NOT NULL,
  `views` varchar(255) NOT NULL,
  `replies` varchar(255) NOT NULL,
  `lastViewBy` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3",

"CREATE TABLE IF NOT EXISTS `forum_category` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `cat_name` varchar(255) NOT NULL,
  `cat_description` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2",

"CREATE TABLE IF NOT EXISTS `forum_main` (
  `forum_title` varchar(255) NOT NULL,
  `forum_description` varchar(255) NOT NULL,
  `forum_status` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1",

"CREATE TABLE IF NOT EXISTS `forum_q` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `sub_id` varchar(255) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `poster` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `body` varchar(255) NOT NULL,
  `date` varchar(255) NOT NULL,
  `views` varchar(255) NOT NULL,
  `replies` varchar(255) NOT NULL,
  `lastView` varchar(255) NOT NULL,
  `lastViewBy` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2",

"CREATE TABLE IF NOT EXISTS `forum_rights` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `post` varchar(255) NOT NULL,
  `thread` varchar(255) NOT NULL,
  `delete` varchar(255) NOT NULL,
  `edit` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1",

"CREATE TABLE IF NOT EXISTS `forum_stats` (
  `total_posts` varchar(255) NOT NULL,
  `total_topics` varchar(255) NOT NULL,
  `total_subs` varchar(255) NOT NULL,
  `total_description` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1",

"CREATE TABLE IF NOT EXISTS `forum_subs` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `cat_id` varchar(255) NOT NULL,
  `sub_name` varchar(255) NOT NULL,
  `sub_detail` varchar(255) NOT NULL,
  `views` varchar(255) NOT NULL,
  `replies` varchar(255) NOT NULL,
  `lastPost` varchar(255) NOT NULL,
  `lastPostOn` varchar(255) NOT NULL,
  `forum_post` varchar(255) NOT NULL,
  `forum_start_topics` varchar(255) NOT NULL,
  `forum_delete` varchar(255) NOT NULL,
  `forum_edit` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2",

"CREATE TABLE IF NOT EXISTS `friends` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `friend` varchar(255) NOT NULL,
  `foe` varchar(255) NOT NULL,
  `friends` varchar(255) NOT NULL,
  `foes` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1",

"CREATE TABLE IF NOT EXISTS `jokes` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `contents` mediumtext NOT NULL,
  `category` varchar(255) NOT NULL,
  `comments` varchar(255) NOT NULL,
  `views` varchar(255) NOT NULL,
  `allowComments` varchar(255) NOT NULL,
  `lastViewed` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1",

"CREATE TABLE IF NOT EXISTS `modules` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `file` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1",

"CREATE TABLE IF NOT EXISTS `pictures` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `category` varchar(255) NOT NULL,
  `comments` varchar(255) NOT NULL,
  `views` varchar(255) NOT NULL,
  `allowComments` varchar(255) NOT NULL,
  `height` varchar(255) NOT NULL,
  `width` varchar(255) NOT NULL,
  `extension` varchar(255) NOT NULL,
  `name2` varchar(255) NOT NULL,
  `lastViewed` varchar(255) NOT NULL,
  `url` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1",

"CREATE TABLE IF NOT EXISTS `prefs` (
  `captcha` varchar(255) NOT NULL,
  `login` varchar(255) NOT NULL,
  `registration` varchar(255) NOT NULL,
  `logintext` varchar(255) NOT NULL,
  `registrationtext` varchar(255) NOT NULL,
  `emailVerification` varchar(255) NOT NULL,
  `forum_status` varchar(255) NOT NULL,
  `forum_status_msg` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1",

"CREATE TABLE IF NOT EXISTS `privatemessages` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `to` varchar(255) NOT NULL,
  `from` varchar(255) NOT NULL,
  `date` varchar(255) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `body` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1",

"CREATE TABLE IF NOT EXISTS `statistics` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `users` varchar(255) NOT NULL,
  `comments` varchar(255) NOT NULL,
  `videos` varchar(255) NOT NULL,
  `jokes` varchar(255) NOT NULL,
  `pictures` varchar(255) NOT NULL,
  `stories` varchar(255) NOT NULL,
  `total` varchar(255) NOT NULL,
  `siteVisits` varchar(255) NOT NULL,
  `activeUsers` varchar(255) NOT NULL,
  `onlineUsers` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2",

"CREATE TABLE IF NOT EXISTS `users` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `avatar` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `allowEmail` varchar(255) NOT NULL,
  `lastActive` varchar(255) NOT NULL,
  `lastVisit` varchar(255) NOT NULL,
  `visits` varchar(255) NOT NULL,
  `acessLevel` varchar(255) NOT NULL,
  `verified` varchar(255) NOT NULL,
  `forum_theme` varchar(255) NOT NULL,
  `signature` varchar(255) NOT NULL,
  `forum_post` varchar(255) NOT NULL,
  `forum_start_topics` varchar(255) NOT NULL,
  `forum_delete` varchar(255) NOT NULL,
  `forum_edit` varchar(255) NOT NULL,
  `rand_ver_id` varchar(255) NOT NULL,
  `posts` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2",

"CREATE TABLE IF NOT EXISTS `usersonline` (
  `username` varchar(255) NOT NULL,
  `true` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1",

"CREATE TABLE IF NOT EXISTS `videos` (
  `ID` tinyint(4) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `comments` varchar(255) NOT NULL,
  `views` varchar(255) NOT NULL,
  `allowComments` varchar(255) NOT NULL,
  `lastViewed` varchar(255) NOT NULL,
  `url` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1"
);

$insert = array("INSERT INTO `forum_a` (`ID`, `sub_id`, `q_id`, `subject`, `poster`, `body`, `date`, `views`, `replies`, `lastViewBy`) VALUES
(1, '1', '1', 'Testing Question', 'User1', 'This is a reply to my question.', '6/6/2008', '0', '0', 'User1 - 6/6/2008'),
(2, '1', '1', 'Answer to Testing Question', 'Admin', 'This is a reply to your question and I don''t even exist!.', '6/6/2008', '0', '0', 'Admin - 6/6/2008')",

"INSERT INTO `forum_category` (`ID`, `cat_name`, `cat_description`) VALUES
(1, 'General Purpose', 'A category for the general purpose')",

"INSERT INTO `forum_main` (`forum_title`, `forum_description`, `forum_status`) VALUES
('Entertainment System Forum', 'A forum for all of your entertainment needs. (This is a description if you haven''t noticed yet', '1'),
('Entertainment System Forum', 'A forum for all of  your entertainment needs', '1')",

"INSERT INTO `forum_q` (`ID`, `sub_id`, `subject`, `poster`, `description`, `body`, `date`, `views`, `replies`, `lastView`, `lastViewBy`) VALUES
(1, '1', 'Testing Question', 'User1', 'A question for the testing', 'This is my test. I hope I don''t fail it.', '6/6/2008', '0', '2', 'Answer to Testing Question', 'Admin - 6/6/2008')",

"INSERT INTO `forum_stats` (`total_posts`, `total_topics`, `total_subs`, `total_description`) VALUES
('1', '1', '1', 'The forum''s statistics')",

"INSERT INTO `forum_subs` (`ID`, `cat_id`, `sub_name`, `sub_detail`, `views`, `replies`, `lastPost`, `lastPostOn`, `forum_post`, `forum_start_topics`, `forum_delete`, `forum_edit`) VALUES
(1, '1', 'Rules', 'Read the forum rules before posting anything', '0', '1', 'Testing Question', 'Admin - 6/6/2008', '1', '1', '1', '1')",

"INSERT INTO `prefs` (`captcha`, `login`, `registration`, `logintext`, `registrationtext`, `emailVerification`, `forum_status`, `forum_status_msg`) VALUES
('1', '1', '1', 'Log in to your account to use your benefits', 'Register to obtain all of membership benefits', '1', '1', 'The forum has being temporarily disabled')",

"INSERT INTO `statistics` (`ID`, `users`, `comments`, `videos`, `jokes`, `pictures`, `stories`, `total`, `siteVisits`, `activeUsers`, `onlineUsers`) VALUES
(1, '1', '0', '0', '0', '0', '0', '0', '0', '1', '1')",

"INSERT INTO `users` (`ID`, `username`, `avatar`, `name`, `password`, `email`, `allowEmail`, `lastActive`, `lastVisit`, `visits`, `acessLevel`, `verified`, `forum_theme`, `signature`, `forum_post`, `forum_start_topics`, `forum_delete`, `forum_edit`, `rand_ver_id`, `posts`) VALUES
(1, 'User1', 'Images/noav.jpg', 'Username', '52ee1edf456c54f4213a189f8454b489', 'email@email.com', '1', '1240191686', '', '1', '1', '1', 'Default', 'This is your signature. You can edit it in the User Control Panel', '1', '1', '1', '1', 'ecadc2da47', '2')",
);