title: Fatal error: Uncaught ArgumentCountError: mysqli_select_db() expects exactly 2 arguments, 1 given
body: <p>I am doing a simple copy and paste for class into a connect.php file to connect to my sample database &quot;fun&quot; The code is below and when I try to connect I get</p>
  <blockquote>
  <p>Connection established.</p>
  <p>Fatal error: Uncaught ArgumentCountError: mysqli_select_db() expects exactly 2 arguments, 1 given in C:\xampp\htdocs\connect.php:10 Stack trace: #0 C:\xampp\htdocs\connect.php(10): mysqli_select_db('fun') #1 {main} thrown in C:\xampp\htdocs\connect.php on line 10</p>
  </blockquote>
  <pre><code>&lt;?php
   $db_host = &quot;localhost&quot;;
   $db_username = &quot;root&quot;;
   $db_passwd = &quot;&quot;;
   $db= @mysqli_connect($db_host, $db_username, $db_passwd) or die (&quot;Could not
  connect!\n&quot;);
   echo &quot;&lt;h1&gt; &lt;font color=green&gt;Connection established.&lt;br&gt;&quot;; 
   $db_name= &quot;fun&quot;;
  
  @mysqli_select_db (&quot;$db_name&quot;) or die (&quot;Could not select the database $dbname!\n&quot;);
   echo &quot;&lt;h2&gt; &lt;font color=blue&gt;Database $db_name is selected.&lt;br&gt;&quot;;
   echo &quot;&lt;br&gt;&lt;font color=red&gt;\&quot;Today was good. ;
  ?&gt;
  </code></pre>
  <p>Is there supposed to be something else in () besides $db_name? I'm not sure what other argument it needs.</p>