Guest User

db.php

a guest
Jan 18th, 2017
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. <?php
  2.     session_start();
  3.     $host = 'localhost';
  4.     $user = 'root';
  5.     $password = '';
  6.     $db = 'shop';
  7.    
  8.     $connect = mysqli_connect($host, $user, $password, $db);
  9.     if(!$connect)
  10.     {
  11.         echo 'Ошибка подключения';
  12.     }
  13.     else
  14.     {
  15.         return true;
  16.     }
  17.     mysqli_select_db($db);
  18.     mysqli_query("SET NAMES utf8");
  19.    
  20. ?>
Add Comment
Please, Sign In to add comment