title: Warning: mysqli_query() expects at least 2 parameters,1 given in [...]
body: <ul>
  <li><strong>Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp\htdocs\Quman\registar.php on line 11</strong></li>
  <li><strong>Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in C:\xampp\htdocs\Quman\registar.php on line 12</strong></li>
  <li><strong>Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp\htdocs\Quman\registar.php on line 23</strong></li>
  <li><strong>Warning: mysqli_error() expects exactly 1 parameter, 0 given in C:\xampp\htdocs\Quman\registar.php on line 23</strong></li>
  </ul>
  
  <p>Code:</p>
  
  
  
  <pre><code>    if (isset($_POST['criar'])) {
          $nome = $_POST['nome'];
          $apelido = $_POST['apelido'];
          $email = $_POST['email'];
          $pass = $_POST['pass'];
          $data = date("Y/m/d");
  
          $email_check = mysqli_query("SELECT email FROM users WHERE email='$email'");
          $do_email_check = mysqli_num_rows($email_check);
          if ($do_email_check &gt;= 1) {
              echo '&lt;h3&gt;Este email já está registado, faça o login, caso seja o seu, entre &lt;a href="login.php"&gt;aqui!&lt;/a&gt;&lt;/h3&gt;';
          }elseif ($nome == '' OR strlen($nome)&lt;3) {
              echo '&lt;h3&gt;Escreva seu nome corretamente!&lt;/h3&gt;';
          }elseif ($email == '' OR strlen($email)&lt;10) {
              echo '&lt;h3&gt;Escreva seu email corretamente!&lt;/h3&gt;';
          }elseif ($pass == '' OR strlen($pass)&lt;8) {
              echo '&lt;h3&gt;Escreva a palavra-passe corretamente, deve possuir no mínino 8 caracteres!&lt;/h3&gt;';
          }else{
              $query = "INSERT INTO users (`nome`,`apelido`,`email`,`password`,`data`) VALUES ('$nome','$apelido','$email','$pass','$data')";
              $data = mysqli_query($query) or die(mysqli_error());
              if ($data) {
                  setcookie("login",$email);
                  header("Location: ./");
              }else{
                  echo "&lt;h3&gt;Desculpe, houve um erro ao registar-se...&lt;/h3&gt;";
              }
          }
      }
  </code></pre>