Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2. $user = 'user';//that you have given in php myadmin
  3. $pass = 1234;//password you entered
  4. $host = 'localhost';//host you are using, unless your webpage is a part of hosted website, use localhost for all type of control panel, Xampp as well as wampp
  5. $db = 'mydb';//name of my database
  6.  
  7. if($dbcon = mysqli_connect($host,$user,$pass,$db))//checks for validity of the credentials and remember the sequence of these variable should not be changed
  8. {
  9. echo "database connected";//if connection established
  10. }
  11. else {
  12. die('error');
  13. }
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement