title: MySQLi equivalent of mysql_result()?
body: <p>I'm porting some old PHP code from mysql to MySQLi, and I've ran into a minor snag. </p>
  
  <p>Is there no equivalent to the old <code>mysql_result()</code> function?</p>
  
  <p>I know <code>mysql_result()</code> is slower than the other functions when you're working with more than 1 row, but a lot of the time I have only 1 result and 1 field. Using it lets me condense 4 lines into 1.</p>
  
  <p>Old code:</p>
  
  <pre><code>if ($r &amp;&amp; mysql_num_rows($r))  
      $blarg = mysql_result($r, 0, 'blah');
  </code></pre>
  
  <p>Desired code:</p>
  
  <pre><code>if ($r &amp;&amp; $r-&gt;num_rows)  
      $blarg = $r-&gt;result(0, 'blah');
  </code></pre>
  
  <p>But there is no such thing. :(</p>
  
  <p>Is there something I'm missing? Or am I going to have to suck it up and make everything:</p>
  
  <pre><code>if ($r &amp;&amp; $r-&gt;num_rows)  
  {  
      $row = $r-&gt;fetch_assoc();  
      $blarg = $row['blah'];  
  }
  </code></pre>