title: Store query result as a string
body: <p>I have used <code>prepare</code>, <code>bind_param</code>, and <code>execute</code> statements to query my database and get only the first column. In php, how would I store the 1st returned value as a string?</p>
  
  <p>In this example of returned values, I would want to store <code>value 1</code> as a string.</p>
  
  <ul>
  <li><code>value 1</code></li>
  <li><code>value 2</code></li>
  <li><code>value 3</code></li>
  </ul>
  
  <p>Actual code:</p>
  
  <pre><code>  //connect to database
  
    $var1 = a;
    $var2 = b;
    $var3 = c;
    $var4 = d;
    $var5 = e;
  
  
    $stmt = $mysqli-&gt;prepare("SELECT id FROM id_list WHERE variable1 = ? &amp;&amp; variable2 = ? &amp;&amp; variable3 = ? &amp;&amp; variable4 = ? &amp;&amp; variable5 = ?");
    $stmt-&gt;bind_param('sssss', $var1, $var2, $var3, $var4, $var5);
  
    $stmt-&gt;execute();
    //How would I get the result here?
    $stmt-&gt;bind_result($result);
    echo $result;
  </code></pre>