title: Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given... what I do wrong?
body: <p>I try make php login but I get this error: <code>Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given,</code> what I do wrong?</p>
  <p>register.php</p>
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang&quot;fi&quot;&gt;
  &lt;head&gt;
  &lt;link rel=&quot;icon&quot; type='image/png' href='images/logo.png'&gt;
  &lt;title&gt;
  asd
  &lt;/title&gt;
  &lt;link href=&quot;css/styles.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot;&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;!--reg alkaa--&gt;
  &lt;form action=&quot;register.php&quot; method=&quot;post&quot;&gt;
  &lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;username&quot; placeholder=&quot;Username&quot;&gt;
  &lt;p&gt;&lt;input type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Email&quot;&gt;
  &lt;p&gt;&lt;input type=&quot;password&quot; name=&quot;pass&quot; placeholder=&quot;Password&quot;&gt;
  &lt;p&gt;&lt;input type=&quot;password&quot; name=&quot;pass1&quot; placeholder=&quot;Password&quot;&gt;
  &lt;p&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Register&quot;&gt;
  &lt;/form&gt;
  &lt;?php
  
  if(isset($_POST['submit']))
  {
  $username = mysqli_real_escape_string($_POST['username']);
  $pass = mysqli_real_escape_string($_POST['pass']);
  $pass1 = mysqli_real_escape_string($_POST['pass1']);
  $email = mysqli_real_escape_string($_POST['email']);
  if($username &amp;&amp; $pass &amp;&amp; $pass1 &amp;&amp; $email)
  {
  if($pass==$pass1)
  {
      $connect = mysql_connect(&quot;mysql.example.com&quot;,&quot;username&quot;,&quot;password&quot;);
      mysql_select_db(&quot;my_database&quot;);
      $query = mysql_query(&quot;INSERT INTO users VALUES('$username','$pass','$email');&quot;);
      echo &quot;You have been registered.&quot;;
  }
  else
  {
      echo &quot;Password must match.&quot;;
  }
  }
  else
  {
  echo &quot;All fields are required.&quot;;
  }
  }
   ?&gt;
  &lt;!--reg end--&gt;
  &lt;Center&gt;
  &lt;a href=&quot;index.php&quot;&gt;
  &lt;h1&gt;
  asd
  &lt;/h1&gt;
  &lt;/center&gt;
  &lt;div id=&quot;main&quot;&gt;
  &lt;h3&gt;
   &lt;div class=&quot;menu&quot;&gt; &lt;a href=&quot;index.php&quot;&gt;Etusivu&lt;/a&gt; &amp;bullet; 
   &lt;a                                       &lt;/div&gt;
  &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class=&quot;jonne&quot;&gt; 
  &lt;/div&gt;
  &lt;script src=&quot;javascript/jquery.js&quot;&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I use 000webhost and this first time when I use mysql databases online.</p>