title: How to write where statement with INNER JOIN to view specific data PHP
body: <p>I have two table 
  table 1- user_table 
  It have UserId, name ,emali .</p>
  
  <p>and table 2</p>
  
  <p>movies table it have movies_id ,name,image ,UserId.</p>
  
  <p>for example what I need to do .. I see now  (movie number-1) so with (movie number -1) I want show data of user from user_table. data of the user who posted this movie. </p>
  
  <p>In table of movies I was create field of UserId that UserId same number in user_table.
  So there is a link between tables of movie field and user_table</p>
  
  <p>I write code same that :</p>
  
  <pre><code>&lt;?php
  include ("connt.php");
  $movie_id = strip_tags(trim($_GET["movie_id"]));
  $sql="SELECT movies.movie_id, users_table.UserId ,users_table.name ,users_table.email 
  FROM movies INNER JOIN users_table 
  ON movies.UserId=users_table.UserId WHERE users_table.UserId = movies.UserId";
  $result=mysqli_query($con,$sql);
  
  $data=array();
  while($row=mysqli_fetch_assoc($result)){
  $data["data"][]=$row;
  
  }
  
  
      echo json_encode($data);
  
  ?&gt;
  
  </code></pre>
  
  <p>It works but displays all movies the user has written.I don't need to view all the movies the user has written. I just need the data for one time, based on the movie ID  or on the movie that I'm watching.</p>
  
  <p>It works as follows now :</p>
  
  <pre><code>{"data":[{"movie_id":"103","UserId":"16","name":"z","email":"z"},{"movie_id":"202","UserId":"16","name":"z","email":"z"}]}
  
  
  </code></pre>
  
  <p>And now I watching movie number3 it's have id 103 so what I need now like that:</p>
  
  <pre><code>{"data":[{"movie_id":"103","UserId":"16","name":"z","email":"z"}
  
  
  </code></pre>