Site Tracker using PHP and Ajax. (fetch.php Page) part 5

PHOTO EMBED

Tue Apr 13 2021 03:04:46 GMT+0000 (UTC)

Saved by @benrobo #php #javasc #html

<?php 
require("db.php");


if(isset($_POST['fetch'])){
    $sql = mysqli_query($conn, "SELECT * FROM views");
    $data = mysqli_fetch_assoc($sql);
    $count = $data['count'];

    if(mysqli_num_rows($sql) > 0){
        echo $count;
    }else{
        echo "0";
    }
}else{
    return false;
}


?>
content_copyCOPY