SHARE
TWEET

Untitled

vladgen Nov 18th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. /** Имя базы данных */
  4. define('DB_NAME', 'new');
  5.  
  6. /** Имя пользователя MySQL */
  7. define('DB_USER', 'root');
  8.  
  9. /** Пароль к базе данных MySQL */
  10. define('DB_PASSWORD', '');
  11.  
  12. /** Имя сервера MySQL */
  13. define('DB_HOST', 'localhost');
  14.  
  15. /** Таблица MySQL */
  16. define('DB_TABLE', 'short');
  17.  
  18. function db_connect(){
  19.     $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
  20.     if ($mysqli->connect_errno) {
  21.         echo "Не удалось подключиться к MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
  22.     }else
  23.     return $mysqli;
  24. }
  25.  
  26. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top