Basic PHP Object Oriented MYSQL Query
<p>So I've been learning for about 3 months now and am currently using very old procedural techniques and the deprecated mysql extension in my code.  So time to take a step forward, ditch my procedural ways and get into object oriented / prepared statements...</p>

<p>This is very basic but I guess everyone has to learn some day.  I'm trying to get retrieve and simple dataset from mysql database..</p>

<p>so far I have my connection:</p>

<pre><code>$useri = new mysqli('localhost', 'useri', 'xxx','yyy');
if(mysqli_connect_errno()){
    echo mysqli_connect_error();
        }
</code></pre>

<p>I get no errors so I assume this works, and I have my query:</p>

<pre><code>$test_query = "SELECT * FROM t";
$test_query = $useri-&gt;real_escape_string($test_query);
 echo $test_query;
  if($result = $useri-&gt;query($test_query)){
   while($row = $useri-&gt;fetch_object($result)){
    echo $row-&gt;id;
 }
 $result-&gt;close();
}
$useri-&gt;close();
</code></pre>

<p>However I get no results... so, 2 questions:</p>

<p>a. what am I doing wrong? and</p>

<p>b. anyone recommend any good tutorials apart from the php manual for this stuff?</p>

<p>Thanks   :)</p>
