Advertisement
Guest User

Untitled

a guest
May 15th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2. //We start by defining some variables for use during connection
  3. $mysql_host = "127.0.0.1";
  4. $mysql_username = "martin8412dk";
  5. $mysql_password = "";
  6. $mysql_database = "martin8412dk";
  7. function connect() {
  8. //Connect to database
  9. if(!$link = mysql_connect($mysql_host, $mysql_username, $mysql_password)) {
  10. die(mysql_error());
  11. }
  12. //Select database
  13. if(!$db = mysql_select_db($mysql_database, $link)) {
  14. die(mysql_error());
  15. }
  16. }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement