Facebook
From Jan Kowal, 2 Months ago, written in PHP.
Embed
Download Paste or View Raw
Hits: 69
  1. <?php
  2.         define (DB_USER, "root");
  3.         define (DB_PASSWORD, "");
  4.         define (DB_DATABASE, "laravel1");
  5.         define (DB_HOST, "localhost");
  6.         $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
  7.  
  8.         $title  = $_POST["title"];  
  9.     $sql = 'SELECT * FROM videos where title LIKE "$title%"';
  10.     $result = $mysqli->query($sql);
  11.    
  12.     while($row = $result->fetch_assoc()){
  13.          $json[] = $row;
  14.     }
  15.       $data['data'] = $json;