Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. <?php
  2.  
  3. class StoreAPI{
  4.  
  5. private $queries;
  6.  
  7. public function __construct($queries){
  8. $this->queries = $queries;
  9. }
  10.  
  11. public function dbInit($charset = 'latin1'){
  12. $data = $this->queries->tableExists('donations');
  13. if(!empty($data)){
  14. return '<div class="alert alert-warning">Database already initialised!</div>';
  15. } else {
  16. $data = $this->queries->createTable("donations", "`id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`), `userID` int NOT NULL, `amount` TEXT(5), `date` TEXT, `processed` TEXT, `sandbox` TEXT, `first_name` TEXT, `last_name` TEXT, `payer_email` TEXT, `expires` TEXT, `expired` TEXT, `canGet` INT","ENGINE=InnoDB DEFAULT CHARSET=$charset");
  17. $data = $this->queries->createTable("players","`userID` int, `amount` TEXT(5)", "ENGINE=InnoDB DEFAULT CHARSET=$charset");
  18. // Success
  19. return true;
  20. }
  21. }
  22.  
  23. }
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement