Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. // create config.php and put below code and include this file where you want to use
  3. // Create database connection php
  4.  
  5. define("serverName", "localhost"); // You can also use 127.0.0.1
  6. define("userName", "root"); // You can also change username in phpmyadmin settings
  7. define("Password", ""); // In windows xammp password is blan but in mac password is also root
  8. define("databaseName", "databaseName"); // Your database name
  9.  
  10. function __construct() {
  11.  
  12. $con = mysql_connect(serverName, userName, Password, databaseName) or die(mysql_error()."<br>Unable to connect with server");
  13. if($con) {
  14. $dbConnect = mysql_select_db(databaseName);
  15. }
  16.  
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement