title: mysqli, OOP vs Procedural
body: <p>I just saw this for the first time.   I had no idea you can instantiate a mysqli class by doing something like</p>
  
  <pre><code>new mysqli( $host, $username, $password, $db );
  </code></pre>
  
  <p>This is brand new to me...Every tutorial I have seen online or in books when connecting to database does something like this:</p>
  
  <pre><code>$conn = mysqli_connect( $host, $username, $password, $db );
  
  if ( !$conn ) {
      die( 'Sorry, could not connect');
  }
  </code></pre>
  
  <p>Is there a reason why most tutorials do it the procedural way?  Even in tutorials I have seen on creating a separate database class, tell me to use the procedural style code...</p>
  
  <p>What's the difference with mysqli procedural vs oop? Is there any?  Do I have to install any extensions of some kind or can I just start using in my code?  Total newb here, so not really sure.</p>
  
  <p>Also, when is it a good idea to use PDO vs mysqli?  Is PDO used most commonly by developers that work on large scale Enterprise applications?  Or is simply a matter of preference.</p>
  
  <p>Thanks for any help...</p>
  
  <p>learning php has quickly become addictive...I just want to know more and more.</p>