Advertisement
Guest User

Untitled

a guest
Jul 9th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1.     <?php
  2.     /////////////////////////////////////////////////////////////////////////////////
  3.         //Database connection
  4.         /////////////////////////////////////////////////////////////////////////////////
  5.         $host="localhost";  // the path to the database, usually localhost,
  6.         $user="user-name";  // your login name, for this part set up a 'select' only user
  7.         $password="your password"; // the password you set - no password is dangerous !!!
  8.         $database='your database';  // The database you want to read
  9.         $link = mysql_connect($host,$user,$password);
  10.           if (!$link)
  11.           {
  12.              $host="the full host name of your server MySQL database";
  13.              $link = mysql_connect($host,$user,$password);
  14.           }
  15.           if (!$link)
  16.           {
  17.               die("Unable to Connect to Server");
  18.           }
  19.     mysql_select_db ($database)or die ('Unable to Select Database ');
  20.     /////////////////////////////////////////////////////////////////////////////////////////////
  21.  
  22.     ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement