Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //you can call this file init.php which has all your connetion details
- <?php
- define('DB_HOST','localhost');
- define('DB_USER','root');
- define('DB_PASSWORD',''); #for security reasons :-)
- define('DB_DATABASE','redwood_new');
- $con = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
- if(!$con){
- echo "Connection error...".mysqli_connect_error();
- }else{
- echo "Database connection success..";
- }
- //then call this before every file that requires it, like:
- <?php
- require "init.php";
- ....
- ....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement