Advertisement
Guest User

Untitled

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