title: Print the Result of a mysqli SELECT Query
body: <p>I am trying to search my database for a result, and display all the columns relating to that result. My connection to the database works fine, but I don't know how to print the result of my query.</p>
  
  <p><img src="https://i.stack.imgur.com/VYYbm.png" alt=""></p>
  
  <p>I tried accessing it as an array, but it did not work. What I want is to be able to search the database for the username 'TEST', and to return the password, email and username (to check the username exists).</p>
  
  <p>My current code is this  </p>
  
  <pre><code>$user = mysqli_query($con,"SELECT * FROM user_list where username = '$username'");
  print_r($user); 
  </code></pre>
  
  <p><code>$username</code> is the username. It returns this </p>
  
  <pre><code>(
      [current_field] =&gt; 0
      [field_count] =&gt; 4
      [lengths] =&gt; 
      [num_rows] =&gt; 2
      [type] =&gt; 0
  )
  </code></pre>