Database Fetch data ajax


I want fetch data from database in same page data fetching .but i want without refresh if any new entry in database inst.php

<table  class="table table-striped table-dark table-dark">

     <thead class="thead-dark">
      <tbody id="auto">
      <th scope="col">Namesss</th>
      <th scope="col">Email</th>
      <th scope="col">Image</th>
      <th scope="col">Update</th>
      <th scope="col">Delete</th>

include "db.php";

$q="select * from users";



<!DOCTYPE html>
<html lang="en">
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <style type="text/css" media="screen">
  .link {
  color: white;
  font-size: 20px;

/* visited link */
a:visited {
  color: cyan;

/* mouse over link */
a:hover {
  background-color: red;

/* selected link */
a:active {
  color: yellow;
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">

  <script src=""></script>
  <script src=""></script>

    <td ><?php echo  $raq[1];?></td>
		<input   type=hidden name="id" value="<?php echo $raq[1]?>">
		<form  class="form-group" action="" method="post" accept-charset="utf-8" enctype="multipart/form-data" >
		<td><?php echo  $raq[0];?></td>
		<td><?php echo  $raq[2];?></td>
		<td><img   src="<?php echo "image/$raq[3]";?>"  height='50 width='50'></td>
		<?php echo "<td><button class='btn btn-primary''text-white'><a  class='link' href=hk.php?id=$raq[1]>Modify</a></td>"?></button>
		<?php echo "<td><button class='btn btn-danger''text-white'><a  class='link' href=del.php?id=$raq[1]>Delete</a></td>"?></button>

<?php }?>





I use this code but page stucks. i want like bootbotsrap badge top of the table
above one div #1

$(document).ready( function(){

function refresh()
setTimeout( function() {


}, 3000);


I wouldn’t load the entire page, just the data.

Why are you loading the entire users table? What are you actually trying to monitor?


i just want if any body register page auto refresh .i want if some one registered auto refresh page
.i dont want this.1st pic i put id. code works but table shows like this after auto refresh structure change.this is with code.if some user register id goes to 10 auto.
my actual table is this.


}, 5000);

this code runs fine .but i want in ajax whole page auto refresh


You are doing a while loop that breaks the html. You can’t have a new html document for each person.


so how can i implement
help me with right code


I’m not going to just write your code for you, this isn’t a code writing service that waits for someone to come along.

Take what I said and fix that first.


its easy bro just rewrite whole div using ajax set all table using ajax instead of refresh page.