Advertisement
Guest User

NEWDB

a guest
Feb 15th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. $server = '127.0.0.1';
  5. $username = 'root';
  6. $password = '';
  7. $database = 'web_database';
  8.  
  9. $connect = mysqli_connect($server,$username,$password);
  10. $select = mysqli_select_db($connect,$database);
  11.  
  12. if(!$connect) {
  13. die ('Error : Unable to establish connection from the database');
  14. }
  15. if(!$select) {
  16. die ('Error : Cannot locate database');
  17. }
  18. else {
  19. echo 'Connected';
  20. }
  21.  
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement