title: Fatal error: Uncaught ArgumentCountError: mysqli_connect_errno() expects exactly 0 arguments, 1 given
body: <p>I received the following error on my localhost:</p>
  <blockquote>
  <p>Fatal error: Uncaught ArgumentCountError: mysqli_connect_errno()
  expects exactly 0 arguments, 1 given in</p>
  </blockquote>
  <p>Using:
  XAMPP v3.2.4, both Apache and MySQL running on correct ports (they are active). It is giving an error on line 52, which is the <code>if</code> statement below.</p>
  <p><strong>Code:</strong></p>
  <pre><code>public function __construct()
       {
          $db = $this-&gt;localDatabase();
          
          $this-&gt;con = mysqli_connect($db['host'], $db['user'], $db['pass'], $db['db']);
          
          if (mysqli_connect_errno($this-&gt;con))
          {
              echo &quot;Failed to connect to MySQL: &quot; . mysqli_connect_error();
          }
      }
  </code></pre>