title: The string is converted to an array and used in the query
body: <p>Sorry for my english!</p>
  
  <p>I think my question is stupid, but i don't know how do it. I have in database string (u_liked) into сompleted (1 2 3), and me need so that every symbol(digit) in this line, insert into value and than value insert in query.</p>
  
  <pre><code>if( isset($_GET["email"]) &amp;&amp; !empty($_GET["email"]) ) {
       $conn = new mysqli("mysql.hostinger.ru", "***", "***", "u858836722_testk");
       $email=$_GET["email"];
       $email = stripslashes($email);
       $email = $conn-&gt;real_escape_string($email);  
  
      $check="SELECT u_liked FROM users WHERE u_id = '".$email."'";
      // 
      $rs1 = mysqli_query($conn,$check);
      $row = mysqli_fetch_assoc($rs1);
  
      $row = stripslashes($row['u_liked']);
      $row = $conn-&gt;real_escape_string($row);
  
  // Don't work query
      $query="SELECT p_id, p_name, p_description, p_image_id, p_price, p_add  FROM products where p_id ='".$row."' ";
  
      $result = $conn-&gt;query($query);
      $outp = "";
     while($rs = $result-&gt;fetch_array(MYSQLI_ASSOC)) {
      if ($outp != "") {$outp .= ",";}
      $outp .= '{"p_id":"'  . $rs["p_id"] . '",';
      $outp .= '"p_name":"'   . $rs["p_name"]        . '",';
      $outp .= '"p_description":"'   . $rs["p_description"]        . '",';
      $outp .= '"p_image_id":"'   . $rs["p_image_id"]        . '",';
      $outp .= '"p_price":"'. $rs["p_price"]     . '",';
      $outp .= '"p_add":"'. $rs["p_add"]     . '"}';
  }
      $has_more=2;
  
    $outp ='{"has_more":'.$has_more.',"records":['.$outp.']}';
      $conn-&gt;close();
      echo($outp);    
  }
  </code></pre>
  
  <p>But when one character is written in the database, I get</p>
  
  <pre><code>{"has_more":2,"records":[{"p_id":"3","p_name":"Готель: Кремінь","p_description":"Телефон: 05367 92300","p_image_id":"chicken_maharaja","p_price":"вулиця Ігоря Сердюка, 1, Кременчук, Полтавська область, 39605","p_add":"http://www.kreminhotel.com.ua/"}]}
  </code></pre>
  
  <p>and it's work</p>
  
  <p>UPDATE 
  It's working!</p>
  
  <pre><code>if( isset($_GET["email"]) &amp;&amp; !empty($_GET["email"]) ) {
       $conn = new mysqli("mysql.hostinger.ru", "u858836722_testk", "80040163q", "u858836722_testk");
       $email=$_GET["email"];
       $email = stripslashes($email);
       $email = $conn-&gt;real_escape_string($email); 
      $check="SELECT u_liked FROM users WHERE u_id = '".$email."'";
      $rs1 = mysqli_query($conn,$check);
      $row = mysqli_fetch_assoc($rs1);    
      $row = explode(' ',$row['u_liked']);
      $row = array_map('intval',$row);
  
  
      $query="SELECT p_id, p_name, p_description, p_image_id, p_price, p_add  FROM products where p_id IN (".implode(',',$row).")";
      $result = $conn-&gt;query($query);
      $outp = "";
     while($rs = $result-&gt;fetch_array(MYSQLI_ASSOC)) {
      if ($outp != "") {$outp .= ",";}
      $outp .= '{"p_id":"'  . $rs["p_id"] . '",';
      $outp .= '"p_name":"'   . $rs["p_name"]        . '",';
      $outp .= '"p_description":"'   . $rs["p_description"]        . '",';
      $outp .= '"p_image_id":"'   . $rs["p_image_id"]        . '",';
      $outp .= '"p_price":"'. $rs["p_price"]     . '",';
      $outp .= '"p_add":"'. $rs["p_add"]     . '"}';
  }
      $has_more=2;
  
    $outp ='{"has_more":'.$has_more.',"records":['.$outp.']}';
      $conn-&gt;close();
      echo($outp);    
  }
  </code></pre>