Last active
May 23, 2019 18:26
-
-
Save mikestratton/d33a27d5f9b4878f5d871733b0aca648 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 | |
//MySQL Database Connect | |
include 'dataconnect.php'; | |
$wp_posts = "wp_posts"; | |
$sql = "SELECT * FROM " . $wp_posts; | |
$result = $conn->query($sql); | |
if ($result->num_rows > 0) { | |
// output data of each row | |
while($row = $result->fetch_assoc()) { | |
echo "<h1>" . $row["post_title"] . "</h1> <p>". $row["post_content"] . "</p><br><hr><br>"; | |
} | |
} else { | |
echo "0 results"; | |
} | |
$conn->close(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment