title: Warning: mysqli_error() expects exactly 1 parameter, 0 given error
body: <p>I get the following error  </p>
  
  <blockquote>
    <p>Warning: mysqli_error() expects exactly 1 parameter, 0 given </p>
  </blockquote>
  
  <p>The problem is with this line of the code:</p>
  
  <pre><code>$query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error()); 
  </code></pre>
  
  <p>The whole code is</p>
  
  <pre><code>session_start();
  
  require_once "scripts/connect_to_mysql2.php";
  
  //Build Main Navigation menu and gather page data here
  
  $sqlCommand = "SELECT id, linklabel FROM pages ORDER BY pageorder ASC";
  
  $query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error()); 
  
  $menuDisplay = '';
  while ($row = mysqli_fetch_array($query)) { 
      $pid = $row["id"];
      $linklabel = $row["linklabel"];
  
      $menuDisplay .= '&lt;a href="index.php?pid=' . $pid . '"&gt;' . $linklabel . '&lt;/a&gt;&lt;br /&gt;';
  
  } 
  mysqli_free_result($query); 
  </code></pre>
  
  <p>The included file has the following line</p>
  
  <pre><code>$myConnection = mysqli_connect("$db_host","$db_username","$db_pass","$db_name") or die ("could not connect to mysql"); with reference to $myConnection, why do I get this error?
  </code></pre>