Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ini_set('display_errors',1); // enable php error display for easy trouble shooting
- error_reporting(E_ALL); // set error display to all
- $username = 'usename'; // username for the database
- $password = 'password'; // password for the database
- $database = 'database_name'; // name for the database
- // define database connection
- // and stop executing the rest of the script with connection error when something goes wrong
- // (example: database does not exists, wrong username, wrong password etc)
- // new for new object. We can have multiple objects at the same time which we will cover it later
- $con = new mysqli("localhost",$username,$password,$database) or die("Error " . mysqli_error($con));
- $con->query("SET NAMES 'utf8'"); // this is for multiple languages database
- $con->query("SET time_zone = 'America/New_York'");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement