-
-
Save emresaracoglu/2de2c07c7555bea350cc1b4d0db35c07 to your computer and use it in GitHub Desktop.
Revisions
-
M165437 revised this gist
Sep 2, 2016 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,14 +7,14 @@ $dbpass = 'pass'; $dbhost = 'host'; $link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); mysqli_select_db($link, $dbname) or die("Could not open the db '$dbname'"); $test_query = "SHOW TABLES FROM $dbname"; $result = mysqli_query($link, $test_query); $tblCnt = 0; while($tbl = mysqli_fetch_array($result)) { $tblCnt++; #echo $tbl[0]."<br />\n"; } @@ -23,4 +23,4 @@ echo "There are no tables<br />\n"; } else { echo "There are $tblCnt tables<br />\n"; } -
chales revised this gist
Jul 18, 2014 . 1 changed file with 14 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,17 +2,25 @@ # Fill our vars and run on cli # $ php -f db-connect-test.php $dbname = 'name'; $dbuser = 'user'; $dbpass = 'pass'; $dbhost = 'host'; $connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); mysql_select_db($dbname) or die("Could not open the db '$dbname'"); $test_query = "SHOW TABLES FROM $dbname"; $result = mysql_query($test_query); $tblCnt = 0; while($tbl = mysql_fetch_array($result)) { $tblCnt++; #echo $tbl[0]."<br />\n"; } if (!$tblCnt) { echo "There are no tables<br />\n"; } else { echo "There are $tblCnt tables<br />\n"; } -
chales revised this gist
Jun 5, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ <?php # Fill our vars and run on cli # $ php -f db-connect-test.php $dbname = 'db-name'; $dbuser = 'db-user'; -
chales created this gist
Apr 28, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ <?php $dbname = 'db-name'; $dbuser = 'db-user'; $dbpass = 'db-pass'; $dbhost = 'db-example-host'; $connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); mysql_select_db($dbname) or die("Could not open the db '$dbname'"); $test_query = "SHOW TABLES FROM $dbname"; $result = mysql_query($test_query); while($row = mysql_fetch_array($result)) { echo $row[0]."<br />\n"; }