title: Can't compare logi infos with database
body: <p>I am trying to compare login infos for my html with the registered ones from sql db but if i let them blank and hit sign in button it redirects me to the booking page.How can i solve this issue?</p>
  
  <pre><code>&lt;?php
  $con=mysqli_connect("","","","");
  // Check connection
  if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  
  // escape variables for security
  $uemail = mysqli_real_escape_string($con, $_POST['uemail']);
  $password = mysqli_real_escape_string($con, $_POST['password']);
  
  
  $DBsql = mysql_query("SELECT 'email', 'password1' FROM register WHERE email = $uemail");
  $sql = mysql_fetch_array($DBsql);
  
  if(($_POST['uemail'] == $sql['email']) &amp;&amp; ($_POST['password'] == $sql['password1'])) {
     echo 'You have succesfully loged in';
     header("Location: http://dev.medialab.teicrete.gr/3597/availability.html");
  } 
  else {
      echo 'One or more fields are not valid';
      header("Location: http://dev.medialab.teicrete.gr/3597/reservation.html");
  }
  
  
  
  
   mysqli_close($con);
  
  
  
   exit;  
   ?&gt; 
  </code></pre>