Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2. $dbname = 'p494505_bany';
  3. $dbuser = 'p494505_loleczek';
  4. $dbpass = 'dawidek';
  5. $dbhost = 'bany-deagleshot.xaa.pl';
  6. $connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
  7. mysql_select_db($dbname) or die("Could not open the db '$dbname'");
  8. $test_query = "SHOW TABLES FROM $dbname";
  9. $result = mysql_query($test_query);
  10. $tblCnt = 0;
  11. while($tbl = mysql_fetch_array($result)) {
  12. $tblCnt++;
  13. #echo $tbl[0]."<br />\n";
  14. }
  15. if (!$tblCnt) {
  16. echo "There are no tables<br />\n";
  17. } else {
  18. echo "There are $tblCnt tables<br />\n";
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement