Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once __DIR__ . '/config.php';
- class API {
- function Select(){
- $db = new Connect;
- $games = array();
- $cheats = array();
- $data = $db->prepare('SELECT name,title,version,image_url FROM games ORDER BY title ASC');
- $data->execute();
- while($outputData = $data->fetch(PDO::FETCH_ASSOC)){
- $games[] = $outputData;
- }
- $data1 = $db->prepare('SELECT name, title, des,mods,type FROM cheats ORDER BY title ASC');
- $data1->execute();
- while($outputData = $data1->fetch(PDO::FETCH_ASSOC)){
- $cheats[] = $outputData;
- }
- $data2 = $db->prepare('SELECT * FROM settings');
- $data2->execute();
- while($outputData = $data2->fetch(PDO::FETCH_ASSOC)){
- $users[] = $outputData;
- }
- $Output=array('games'=>$games,'cheats'=>$cheats, 'settings'=>$users);
- echo(json_encode($Output,JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE| JSON_UNESCAPED_SLASHES));
- }
- }
- $API = new API;
- header('Content-type: application/json; charset=utf-8');
- echo $API->Select();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement