Advertisement
Guest User

Untitled

a guest
Sep 18th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Archon Web</title>
  4. </head>
  5. <body>
  6. <h1><?php echo "ArchonWeb" ?></h1>
  7.  
  8. <?php
  9. $dbname = 'archondb';
  10. $dbuser = 'archon';
  11. $dbpass = 'password';
  12. $dbhost = 'db';
  13.  
  14. $connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
  15.  
  16. mysql_select_db($dbname) or die("Could not open the db '$dbname'");
  17.  
  18. $test_query = "SHOW TABLES FROM $dbname";
  19.  
  20. $result = mysql_query($test_query);
  21.  
  22. $tblCnt = 0;
  23.  
  24. while($tbl = mysql_fetch_array($result)) {
  25. $tblCnt++;
  26. }
  27.  
  28. if (!$tblCnt) {
  29. echo "There are no tables<br />\n";
  30. } else {
  31. echo "There are $tblCnt tables<br />\n";
  32. }
  33.  
  34. ?>
  35.  
  36. </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement