Advertisement
Guest User

Untitled

a guest
Dec 9th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. * DataTables example server-side processing script.
  5. *
  6. * Please note that this script is intentionally extremely simply to show how
  7. * server-side processing can be implemented, and probably shouldn't be used as
  8. * the basis for a large complex system. It is suitable for simple use cases as
  9. * for learning.
  10. *
  11. * See http://datatables.net/usage/server-side for full details on the server-
  12. * side processing requirements of DataTables.
  13. *
  14. * @license MIT - http://datatables.net/license_mit
  15. */
  16.  
  17. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  18. * Easy set variables
  19. */
  20. // Config for database connection
  21. include '../../config.php';
  22.  
  23. // Player UUID
  24. $playerUUID = "";
  25. // DB table to use
  26. $table = 'Stats_move';
  27.  
  28. // Table's primary key
  29. $primaryKey = 'player_id';
  30.  
  31. // Array of database columns which should be read and sent back to DataTables.
  32. // The `db` parameter represents the column name in the database, while the `dt`
  33. // parameter represents the DataTables column identifier. In this case simple
  34. // indexes
  35. $columns = array(
  36. array( 'db' => 'counter', 'dt' => 0 ),
  37. array( 'db' => 'player_id', 'dt' => 1 ),
  38. array( 'db' => 'type', 'dt' => 2 ),
  39. array( 'db' => 'distance', 'dt' => 3 )
  40. );
  41.  
  42. // SQL server connection information
  43. $sql_details = array(
  44. 'user' => DB_USER,
  45. 'pass' => DB_PASSWORD,
  46. 'db' => DB_NAME,
  47. 'host' => DB_HOST
  48. );
  49.  
  50.  
  51. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  52. * If you just want to use the basic configuration for DataTables with PHP
  53. * server-side, there is no need to edit below this line.
  54. */
  55.  
  56. require( '../ssp.class.php' );
  57.  
  58. echo json_encode(
  59. SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
  60. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement