title: get ID for a specific user in mysql database in PHP
body: <p>When a user signs in i want to echo back there ID (which is created because of the auto_increment in phpMyAdmin) from <strong>there</strong> account, here's my login.PHP:</p>
  
  <pre><code>&lt;?php
  
  $conn = mysqli_connect("xxxxxx", "xxxxx", "xxxx", "BuyerAccounts");
  
  $Email = $_POST["Email"];
  $Password = $_POST["Password"];
  
  
  $sql_query = "select Buyer_Email from user_info where Buyer_Email like '$Email' and Buyer_Password like '$Password';";
  
  $result = mysqli_query($conn, $sql_query);
  
  if(mysqli_num_rows($result) &gt; 0 ){
  
  $row = mysqli_fetch_assoc($result);
  $name = $row["Buyer_Email"]; 
  echo "Welcome: Buyer";
  
  }else{
  $int = 1;
  //echo "Buyer login failed...";
  }
  }else{
  echo "Login failed...";
  }
  }
  
  
  mysqli_stmt_close($statement);
  
  mysqli_close($conn);
  
  
  ?&gt;
  </code></pre>