title: PHP with PDO problem mysqli_stmt::fetch()
body: <p>I need to convert my code to PDO and I don't know where is the problem.</p>
  <pre><code>$user = $_SESSION['user_email'];
  $get_user = &quot;SELECT * FROM users where user_email='$user'&quot;; 
  
  //This 2 lines was there in original
  $run_user = mysqli_query($con,$get_user); //original
  $row=mysqli_fetch_array($run_user); //original
  
  //Converting to PDO
  $run_user = $con-&gt;prepare($get_user); 
  $run_user-&gt;execute();
  $row = $run_user-&gt;fetch(PDO::FETCH_ASSOC); //line 27
  
  // line 38 and 39
  $user_id = $row['user_id']; 
  $user_name = $row['user_name']; 
  </code></pre>
  <p>My errors are:</p>
  <blockquote>
  <p>Warning: mysqli_stmt::fetch() expects exactly 0 parameters, 1 given in
  /Applications/XAMPP/xamppfiles/htdocs/network/includes/header.php on
  line 27</p>
  <p>Notice: Trying to access array offset on value of type null in
  /Applications/XAMPP/xamppfiles/htdocs/network/includes/header.php on
  line 38</p>
  <p>Notice: Trying to access array offset on value of type null in
  /Applications/XAMPP/xamppfiles/htdocs/network/includes/header.php on
  line 39</p>
  </blockquote>