Created
April 3, 2019 09:12
-
-
Save ButlerFuqua/d7affcd85b46851d8ddf218c909894ca to your computer and use it in GitHub Desktop.
This file contains 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 characters
<?php | |
$link = mysqli_connect("HOSTNAME", "DATABSEUSERNAME", "PASSWORD", "DATABASE"); | |
if(mysqli_connect_error()){ | |
die("There was an error connecting to the database."); | |
} | |
$query = "SELECT * FROM users"; | |
if($result = mysqli_query($link, $query)){ | |
$row = mysqli_fetch_array($result); | |
foreach ($row as $key => $value){ | |
if(gettype($key) != "integer"){ | |
echo "<p>Your $key is <strong>$value</strong></p>"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment