title: Insert values with if condition with mysqli
body: <p>I am trying to make register member page. If a new member insert an email which has been already exist, then there will be a notification saying that the email is exist. But if the email has not been exist, the values they insert in the form will be send to database. </p>
  
  <p>I don't know what is wrong with my code bellow. It just blank and doesn't send anything to databse. I need a help. </p>
  
  <pre><code>&lt;?php
  //conection:
   $link = mysqli_connect(".com","klaudia","intheclaud","elektro") or die("Error " . mysqli_error($link));
  
  //consultation:
  
   $member_id=$_GET['member_id'];
   $member_name=ucwords(htmlspecialchars($_POST['member_name']));
   $member_email=$_POST['member_email'];
   $member_password=htmlspecialchars($_POST['member_password']);
   $member_phone=$_POST['member_phone'];
   $member_address_satu=ucwords(htmlspecialchars($_POST['member_address_satu']));
   $member_address_dua=ucwords(htmlspecialchars($_POST['member_address_dua']));
   $member_reference=$_POST['member_reference'];
  
  
  
    $query = "SELECT * FROM member_registry WHERE member_email='$member_email '" or die("Error in  the consult.." . mysqli_error($link));
  
   //execute the query.
  
   $result = $link-&gt;query($query);
  
   if (mysqli_num_rows($result) &gt; 0) {
      echo "This email you are using has been registered before";
    }
   else {
  
   mysqli_query($link, "INSERT INTO member_registry (
                                                    'member_id', 
                                                    'member_name', 
                                                    'member_email', 
                                                    'member_password', 
                                                    'member_phone', 
                                                    'member_address_satu', 
                                                    'member_address_dua', 
                                                    'member_reference') 
                                      VALUES (0,1,2,3,4,5,6,7,8)";
  </code></pre>
  
  <p>?> </p>
  
  <p>I have tried to check the connection and the database. Everything works fine here. When I insert someone name which has been in the table of the database, it will echo that the email already exist. and vice versa. </p>
  
  <pre><code>    $query = "SELECT * FROM member_registry WHERE member_name='Klaudia '" or die("Error in the consult.." . mysqli_error($link));
  
      //execute the query.
  
      $result = $link-&gt;query($query);
  
      if (mysqli_num_rows($result) &gt; 0) {
      echo "This email you are using has been registered before";
      }
      else {
      echo "This email you are using has NOT been registered before";   
       }
  </code></pre>
  
  <p><strong>[UPDATE]</strong> </p>
  
  <pre><code>      mysqli_query($link, "INSERT INTO member_registry (
                                                    'member_id', 
                                                    'member_name', 
                                                    'member_email', 
                                                    'member_password', 
                                                    'member_phone', 
                                                    'member_address_satu', 
                                                    'member_address_dua', 
                                                    'member_reference') 
                                      VALUES (0,1,2,3,4,5,6,7,8)");
        }
       ?&gt; 
  </code></pre>