title: OOP selecting data mysql
body: <p>I'm new to OOP and just trying to migrate from mysql_, but I'm running into some issues while migrating.</p>
  
  <pre><code>$konek = new PDO('mysql:host=localhost;dbname=mydatabase', root, root);$hasil = $konek-&gt;query("SELECT * FROM `tabel`");
  while ($data = $hasil-&gt;fetch_object()) {
  echo '&lt;td&gt;'.$data-&gt;something.'&lt;/td&gt;';}
  </code></pre>
  
  <p>It doesn't work or show an error, but when I replace the first line with <code>mysqli</code> it works:</p>
  
  <pre><code>konek = new mysqli('localhost','root','root','mydatabase');
  </code></pre>
  
  <p>Any help would be really appreciated.</p>