Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. Configuration
  2.  
  3.  
  4. This example describes using PHP to connect to a MySQL Database on a Linux hosting account.
  5. <?php
  6. //Connect To Database
  7. $hostname='forumpepo.db.8074409.hostedresource.com';
  8. $username='forumpepo';
  9. $password='your password';
  10. $dbname='forumpepo';
  11. $usertable='your_tablename';
  12. $yourfield = 'your_field';
  13.  
  14. mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.');
  15. mysql_select_db($dbname);
  16.  
  17. $query = 'SELECT * FROM ' . $usertable;
  18. $result = mysql_query($query);
  19. if($result) {
  20. while($row = mysql_fetch_array($result)){
  21. $name = $row[$yourfield];
  22. echo 'Name: ' . $name;
  23. }
  24. }
  25. ?>
  26. For additional information on how to setup your connection string using PHP, please refer to the following help resource references.
  27. Connecting to a MySQL Database on Your Linux Hosting Account Using PHP
  28. Connecting to MySQL Using PHP
  29.  
  30.  
  31. MySQL Database Information
  32. Status:SetupHost Name:forumpepo.db.8074409.hostedresource.comDatabase Name:forumpepoDatabase Version:5.0Description:forumpepoUser Name:forumpepoRead-Only User Name:sedimalko
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. moq config.php
  43.  
  44. <?php
  45. // phpBB 3.0.x auto-generated configuration file
  46. // Do not change anything in this file!
  47. $dbms = 'mysql';
  48. $dbhost = 'forumpepo.db.8074409.hostedresource.com';
  49. $dbport = '';
  50. $dbname = 'forumpepo';
  51. $dbuser = 'forumpepo';
  52. $dbpasswd = 'KTT55am2!';
  53. $table_prefix = 'forumpepo';
  54. $acm_type = 'file';
  55. $load_extensions = '';
  56.  
  57. @define('PHPBB_INSTALLED', true);
  58. // @define('DEBUG', true);
  59. // @define('DEBUG_EXTRA', true);
  60. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement