Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class StoreAPI{
- private $queries;
- public function __construct($queries){
- $this->queries = $queries;
- }
- public function dbInit($charset = 'latin1'){
- $data = $this->queries->tableExists('donations');
- if(!empty($data)){
- return '<div class="alert alert-warning">Database already initialised!</div>';
- } else {
- $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");
- $data = $this->queries->createTable("players","`userID` int, `amount` TEXT(5)", "ENGINE=InnoDB DEFAULT CHARSET=$charset");
- // Success
- return true;
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement