Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. // Database stuff
  2. $exists = $queries->tableExists('vote_settings');
  3. if(empty($exists)){
  4. // Create tables
  5. try {
  6. $data = $queries->createTable("vote_settings", " `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(20) NOT NULL, `value` varchar(2048) NOT NULL, PRIMARY KEY (`id`)", "ENGINE=InnoDB DEFAULT CHARSET=latin1");
  7. $data = $queries->createTable("vote_sites", " `id` int(11) NOT NULL AUTO_INCREMENT, `site` varchar(512) NOT NULL, `name` varchar(64) NOT NULL, PRIMARY KEY (`id`)", "ENGINE=InnoDB DEFAULT CHARSET=latin1");
  8.  
  9. // Insert data
  10. $queries->create('vote_settings', array(
  11. 'name' => 'vote_message',
  12. 'value' => ''
  13. ));
  14. $queries->create('vote_settings', array(
  15. 'name' => 'link_location',
  16. 'value' => '1'
  17. ));
  18. $queries->create('vote_settings', array(
  19. 'name' => 'icon',
  20. 'value' => '1'
  21. ));
  22. } catch(Exception $e){
  23. // Error
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement