Advertisement
Guest User

config problem php

a guest
Mar 18th, 2016
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. <?php
  2. $host="...."; // Host name
  3. $username="...."; // Mysql username
  4. $password="......."; // Mysql password
  5. $db_name="...."; // Database name
  6.  
  7. // Connect to server and select databse.
  8. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  9. mysql_select_db("$db_name")or die("cannot select DB");
  10. ?>
  11.  
  12.  
  13. another php file:
  14.  
  15. <?php
  16. include('config.php');
  17. ...
  18. sql query
  19. ...
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement