Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. function connect(){
  2. $config = parse_ini_file('/var/www/website.com/db.ini');
  3. $con = mysqli_connect("localhost",$config['username'],$config['password'],$config['db']);
  4. if(!$con){
  5. die("Failed to connect to Database");
  6. }
  7. return $con;
  8. }
  9.  
  10. username=user123
  11. password=pass123
  12. db=mydb
  13.  
  14. -rw-r--r-- 1 root root 84 /var/www/website.com/db.ini
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement