A simple template for quick and dirty PHP apps.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

required.php 721B

1234567891011121314151617181920212223242526
  1. <?php
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. require_once __DIR__ . "/settings.php";
  6. require_once __DIR__ . "/vendor/autoload.php";
  7. use Medoo\Medoo;
  8. $database;
  9. try {
  10. $database = new Medoo([
  11. 'database_type' => DB_TYPE,
  12. 'database_name' => DB_NAME,
  13. 'server' => DB_SERVER,
  14. 'username' => DB_USER,
  15. 'password' => DB_PASS,
  16. 'charset' => DB_CHARSET
  17. ]);
  18. } catch (Exception $ex) {
  19. header('HTTP/1.1 500 Internal Server Error');
  20. die("Database error. Try again later. (" . $ex->getMessage() . ")");
  21. }