Skip to content

Instantly share code, notes, and snippets.

@amardeep18
Created July 19, 2020 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amardeep18/285a65bd4f410f870753b7d58dbe9f58 to your computer and use it in GitHub Desktop.
Save amardeep18/285a65bd4f410f870753b7d58dbe9f58 to your computer and use it in GitHub Desktop.
<?php
//fetch.php
$connect = mysqli_connect("localhost", "root", "", "auto_refresh");
$query = "SELECT * FROM tbl_post ORDER BY post_id DESC";
$result = mysqli_query($connect, $query);
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_array($result))
{
echo '<p>'.$row["post_name"].'</p>';
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment