Skip to content

Instantly share code, notes, and snippets.

@hquach hquach/phptest.php
Last active Nov 9, 2018

What would you like to do?
# Fill our vars
$dbname = '';
$dbuser = '';
$dbpass = '';
$dbhost = '';
$connect = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
mysqli_select_db($connect, $dbname) or die("Could not open the db '$dbname'");
$test_query = "DESC users";
$result = mysqli_query($connect, $test_query);
$tblCnt = 0;
while($tbl = mysqli_fetch_array($result)) {
echo $tbl[0]."<br />\n";
if (!$tblCnt) {
echo "There are no tables<br />\n";
} else {
#echo "There are $tblCnt tables<br />\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.