title: display more than one row mysql
body: <p>I am now doing the search function, which is search by ID.
  For example, there are ID 791481, 791431, 791474. If I input 791481, it is able to show the record in the table.</p>
  
  <p>Now I want to input 7914, it is able to show all the record which has the ID which starts with 7914, include (791481, 791431, 791474). How can I do it?</p>
  
  <p>Here is my code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>function getByItem($conn){
   global $resArray;
  
   $id = $_GET["id"];
  
   //for a item id, we need
   //1. item info
   //2. lastest item in out record and related report
   //3. lastest item repair record 
  
   $query = "SELECT * FROM `item` WHERE item_id LIKE'".$id."%'";
   $result = mysqli_query($conn, $query);
  
   $resArray["status"] = "ok";
   if($result){
    if($result-&gt;num_rows &gt; 0){
     $resArray["item"]=mysqli_fetch_assoc($result);
     }
    
    
   }else{
    $resArray["status"] = "fail";
   }
  
   $query = "SELECT * FROM (SELECT * FROM `inoutrecord`  WHERE item_id LIKE'".$id."%') AS I NATURAL JOIN `report` ORDER BY report_date DESC";
   $result = mysqli_query($conn, $query);
   //$resArray["echo1"] = $query;
  
   if($result){
    if($result-&gt;num_rows &gt; 0){
     $resArray["inoutrecord"]=mysqli_fetch_assoc($result);
    }
   }else{
    $resArray["error"] = mysqli_errno($conn).":".mysqli_error($conn);
    $resArray["status"] = "fail";
   }
  
  
   $query = "SELECT * FROM `repairrecord` WHERE item_id LIKE'".$id."%' ORDER BY rr_date DESC";
   $result = mysqli_query($conn, $query);
   //$resArray["echo2"] = $query;
  
  
   if($result){
    if($result-&gt;num_rows &gt; 0){
     $resArray["repairrecord"]=mysqli_fetch_assoc($result);
    }
   }else{
    $resArray["error"] = mysqli_errno($conn).":".mysqli_error($conn);
    $resArray["status"] = "fail";
   }
  
  }</code></pre>
  </div>
  </div>
  </p>