dimanche 22 décembre 2019

Convert simple code core php to laravel framework

  can you please help me to convert core php code to laravel framework. i am getting trouble to converting. i know its silly quetion but need urgently and i am new on php and laravel thats why 

  <?php
    //fetch.php;
    if(isset($_POST["view"]))
    {
     include("connect.php");
     if($_POST["view"] != '')
     {
      $update_query = "UPDATE comments SET comment_status=1 WHERE comment_status=0";
      mysqli_query($connect, $update_query);
     }
     $query = "SELECT * FROM comments ORDER BY comment_id DESC LIMIT 5";
     $result = mysqli_query($connect, $query);
     $output = '';

     if(mysqli_num_rows($result) > 0)
     {
      while($row = mysqli_fetch_array($result))
      {
       $output .= '
       <li>
        <a href="#">
         <strong>'.$row["comment_subject"].'</strong><br />
         <small><em>'.$row["comment_text"].'</em></small>
        </a>
       </li>
       <li class="divider"></li>
       ';
      }
     }
     else
     {
      $output .= '<li><a href="#" class="text-bold text-italic">No Notification Found</a></li>';
     }

     $query_1 = "SELECT * FROM comments WHERE comment_status=0";
     $result_1 = mysqli_query($connect, $query_1);
     $count = mysqli_num_rows($result_1);
     $data = array(
      'notification'   => $output,
      'unseen_notification' => $count
     );
     echo json_encode($data);
    }
    ?>

can you please help me to convert core php code to laravel framework. i am getting trouble to converting. i know its silly quetion but need urgently and i am new on php and laravel thats why



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2sglAIC
via IFTTT

Aucun commentaire:

Enregistrer un commentaire