mysqli_query(): Empty query mysqli_error() expects exactly 1 parameter, 0 given : <p>I am creating a register page. the form has an email, password, confirm password, student ID, first name, second name, Course, Gender and DoB. I want the page to collect that information and store it in the database.</p>

<p>2 Errors:</p>

<p>mysqli_query(): Empty query</p>

<p>mysqli_error() expects exactly 1 parameter, 0 given</p>

<pre><code>        $sql = mysqli_query($connection, "INSERT INTO tblaccounts (Email, Password, Student_ID, ID, FirstName, SecondName, Course, Gender, DoB) VALUES ('".$email."','".$password."','".$Student_ID."','".$id."','".$FN."','".$SN."','".$course."','".$gender."','".$dob."')"); 
        $result = mysqli_query($connection, $sql) or die("Database Connection Failed" . mysqli_error());  
        $count = mysqli_num_rows($result);






    &lt;?php
    require_once 'connect.php';
    require_once 'logincheck.php';

        if (($_COOKIE['userID']) == null){
              //true
              //show sign in
              ?&gt;
                &lt;li&gt;&lt;p&gt;&lt;center&gt;&lt;a class="btn btn-primary btn-lg" href="login.php" role="button"&gt;Sign In&lt;/a&gt;&lt;center&gt;&lt;/p&gt;&lt;/li&gt;
              &lt;?php
              //show register button
              ?&gt;
                &lt;li&gt;&lt;p&gt;&lt;center&gt;&lt;a class="btn btn-primary btn-lg" href="register.php" role="button"&gt;Register&lt;/a&gt;&lt;center&gt;&lt;/p&gt;&lt;/li&gt;
              &lt;?php
        } else {
        //false
        //show 'logged in as'
              ?&gt;
        &lt;li&gt;&lt;a href="#"&gt;Logged in as: &lt;?php echo ($_COOKIE['user']) ?&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;?php//show 'my profile'?&gt;
        &lt;li&gt;&lt;a href="#"&gt;My Profile&lt;/a&gt;&lt;/li&gt;
        &lt;?php//show 'settings'.?&gt;
        &lt;li&gt;&lt;a href="#"&gt;Settings&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;p&gt;&lt;center&gt;&lt;a class="btn btn-primary btn-lg" href="logout.php" role="button"&gt;Sign Out&lt;/a&gt;&lt;center&gt;&lt;/p&gt;&lt;/li&gt;
            &lt;!--&lt;br/&gt;&lt;a href ="login.php"&gt;Go back to the login screen.&lt;/a&gt;--&gt;

                        &lt;!--logged in menu--&gt;
            &lt;!--&lt;li&gt;&lt;a href="#"&gt;User ID: &lt;php echo ($_COOKIE['userID']) ?&gt;&lt;/a&gt;&lt;/li&gt;--&gt;
    &lt;/ul&gt;
    &lt;?php
        } 
    ?&gt;
</code></pre>
