File "index.php"

Full Path: /home/custbahd/tourismfraternity.com/admin/counter/get-comment/index.php
File size: 1.94 KB
MIME-type: text/x-php
Charset: utf-8

<?php

  include_once "../../../admin/counter/db/config.php";

  include '../../../admin/db/saucerer.php';

  $blog_id = $_GET['blog_id'];

?>



                                    
                                <div class="comments-option">

<?php

$sql = "SELECT count(*) FROM comments WHERE blog_id='$blog_id' AND deleted='' ORDER BY id DESC"; 

$result = $conn->query($sql); 

while($row = mysqli_fetch_array($result)) {

    if ($row['count(*)']==0) {
        echo '<h4 class="comments-title">No Comments</h4>';
    } elseif ($row['count(*)']==1) {
        echo '<h4 class="comments-title">'.$row['count(*)'].' Comment</h4>';
    } else {
        echo '<h4 class="comments-title">'.$row['count(*)'].' Comments</h4>';
    }
    

}

?> 

    <?php

$sql = "SELECT * FROM comments WHERE blog_id='$blog_id' AND deleted='' ORDER BY id DESC"; 

$result = $conn->query($sql); 

while($row = mysqli_fetch_array($result)) {

    echo '<div class="comments-items">
                                        <div class="comments-image">
                                            <i class="fa fa-user-tag"></i>
                                        </div>

                                        <div class="comments-content">
                                            <div class="comments-author-title">
                                                <div class="comments-author-name">
                                                    <h4>'.$row["c_name"].' <small>- '.date("jS M, Y", strtotime($row["timestamp"])).'</small></h4>
                                                </div>
                                            </div>

                                            <p>'.$row["comment"].'</p>
                                        </div>
                                    </div>';
    

}

?> 

                                </div>