title: store result of sql request in a variable php
body: <p>With a <code>POST</code> request, I get the name of someone that I want to link with its id the mySQL database. For that, I create a query as you can see below and I need to put the result (a simple number) into a variable to use it for other queries. </p>
  
  <p>I know that I could make joints with SQL but I'm trying to do it this way.</p>
  
  <pre><code>$owner = $_POST['owner'];
  
  $queryUser = "SELECT id FROM collections WHERE name = '$owner'";
  $idUser = $mysqli-&gt;query($queryUser) or die($mysqli-&gt;error.__LINE__);
  </code></pre>
  
  <p>With this code, I can't use <code>$idUser</code>because it appears as an 0, a 1 (recogniezd as an array?) or nothing  when I try to write it somewhere in my database. I tried to use the <code>intval()</code> function with no results...</p>
  
  <p>Any help?</p>