Last active
May 23, 2019 18:26
-
-
Save mikestratton/d33a27d5f9b4878f5d871733b0aca648 to your computer and use it in GitHub Desktop.
Revisions
-
mikestratton revised this gist
May 23, 2019 . 1 changed file with 4 additions and 1 deletion.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,10 +1,12 @@ <?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()) { @@ -14,4 +16,5 @@ if ($result->num_rows > 0) { echo "0 results"; } $conn->close(); ?> -
mikestratton created this gist
May 23, 2019 .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,17 @@ // Displays Wordpress posts, in raw data(HTML) format, pulling from the MySql / wp-posts table. <?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(); ?>