Guest User

Untitled

a guest
Aug 11th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. unable to connect to mySQL Db
  2. <?php
  3. echo "Hello World n";
  4.  
  5. $mysql_host = "MySQL Host"; // this is what specified to use in mySQL management page at my host
  6. $mysql_database = "mysql_database";
  7. $mysql_user = "mysql_user";
  8. $mysql_password = "mysql_password";
  9.  
  10. echo $mysql_host;
  11.  
  12. $conn = mysql_connect($mysql_host, $mysql_user, $mysql_password);
  13. if (!$con)
  14. {
  15. die('Could not connect: ' . mysql_error());
  16. }
  17. $db_selected = mysql_select_db($mysql_database);
  18.  
  19. if (!$db_selected) {
  20. die ('Can't use '.$mysql_database.' : ' . mysql_error());
  21. }
  22. ?>
  23.  
  24. $mysql_host = "MySQL Host";
Add Comment
Please, Sign In to add comment