Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // create config.php and put below code and include this file where you want to use
- // Create database connection php
- define("serverName", "localhost"); // You can also use 127.0.0.1
- define("userName", "root"); // You can also change username in phpmyadmin settings
- define("Password", ""); // In windows xammp password is blan but in mac password is also root
- define("databaseName", "databaseName"); // Your database name
- function __construct() {
- $con = mysql_connect(serverName, userName, Password, databaseName) or die(mysql_error()."<br>Unable to connect with server");
- if($con) {
- $dbConnect = mysql_select_db(databaseName);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement