Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $user = 'user';//that you have given in php myadmin
- $pass = 1234;//password you entered
- $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
- $db = 'mydb';//name of my database
- 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
- {
- echo "database connected";//if connection established
- }
- else {
- die('error');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement