Guest User

Untitled

a guest
Nov 24th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. <?php
  2.  
  3. $hostname = "localhost";
  4. $username = "root";
  5. $password = "";
  6. $port = 3306;
  7.  
  8. function sqlConnect ( $database_ )
  9. {
  10. $mysqli = mysqli_connect( $GLOBALS["hostname"], $GLOBALS["username"], $GLOBALS["password"], $database_, $GLOBALS["port"] );
  11.  
  12. if ( mysqli_connect_errno() )
  13. {
  14. exit();
  15. return false;
  16. }
  17. return $mysqli;
  18. }
  19.  
  20. ?>
Add Comment
Please, Sign In to add comment