Search
 
SCRIPT & CODE EXAMPLE
 

PHP

converting php to codeigniter

<?php
    include('connect.php');
    if(isset($_POST['view'])){
    // $con = mysqli_connect("localhost", "root", "", "company");
    if($_POST["view"] != '')
    {
       $update_query = "UPDATE comments SET comment_status = 1 WHERE comment_status=0";
       mysqli_query($con, $update_query);
    }
    $query = "SELECT * FROM comments ORDER BY comment_id DESC LIMIT 5";
    $result = mysqli_query($con, $query);
    $output = '';
    if(mysqli_num_rows($result) > 0)
    {
    while($row = mysqli_fetch_array($result))
    {
      $output .= '
      <li>
      <a href="#">
      <strong>'.$row["title"].'</strong><br />
      <small><em>'.$row["details"].'</em></small>
      </a>
      </li>
      ';
    }
    }
    else{
        $output .= '<li><a href="#" class="text-bold text-italic">No Noti Found</a></li>';
    }
    $status_query = "SELECT * FROM comments WHERE comment_status=0";
    $result_query = mysqli_query($con, $status_query);
    $count = mysqli_num_rows($result_query);
    $data = array(
       'notification' => $output,
       'unseen_notification'  => $count
    );
    echo json_encode($data);
    }
    ?>
Comment

PREVIOUS NEXT
Code Example
Php :: google sheets to php equation 
Php :: php glob multiple file with different formats in directory 
Php :: symfony 3.4 migrer database 
Php :: Laravel Http client throw exception if request is not successful 
Php :: storefront product search 
Php :: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in C:xampphtdocsJob Verificationlogin esult.php on line 38 
Php :: en php comment convertir une date en français stackoverflow 
Php :: php file handling 
Php :: php datenbank beschreiben 
Php :: count vs sizeof php 
Php :: how i can send by database table in laravel full calendar 
Php :: how to include page specific css in xphp smart header 
Php :: php replace all text from string with associate array values 
Php :: generate rand password php 
Php :: phpmyadmin timedeconnexion : a placer tt en bas dans "config.inc.php" 
Php :: image_lib codeigniter add _thumb 
Php :: No match for argument: phpmyadmin yum 
Php :: When you click on the search button, it is moved to the page laravel 
Php :: count letters in string without space or characters and numbers in php 
Php :: how to use php variable in javascript file 
Php :: laravel relationship example 
Php :: fix-wordpress-limit-permalink 
Php :: omnipay capture 
Php :: convert any date to db date in suitecrm 
Php :: pusher in laravel array_merge(): Argument #2 is not an array 
Php :: add element to this array 
Php :: how to fetch group name in custom post type in wordpress 
Php :: add class to all text input wordpress 
Php :: implode (PHP 4, PHP 5, PHP 7, PHP 8) implode — Join array elements with a string 
Php :: Who developed Laravel? 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =