<?php

include_once('db_ouichat.php');
ini_set('max_execution_time', 120);

   $first = true;
   $q = "select sql_no_cache * from log_pantalla";
   $result = $conn->query( $q );
   if( $result->num_rows > 0 ) {

      while($row = $result->fetch_assoc()) {
         if( $first == false ) echo ",";
         $line = $row["Line"];
         $mensaje = $row["Mensaje"];
         echo "{\"line\":\"" . $line . "\",\"mensaje\":\"" . $mensaje . "\"}";
         $first = false;
      }
      echo "]";
   }
   else echo "[]";
   if( is_resource($result) ) mysql_free_result( $result );
   mysqli_close($conn);
?>

