title: How to get the user_id created in Database using PHP?
body: <p>I try to use SESSION or without. Maybe I have a issues using SESSION.
  In phpMyAdmin I am using <code>userid int(11) auto_increment</code>.</p>
  
  <p>All what created using POST method work.</p>
  
  <pre><code>&lt;?php
  session_start();    
  $con = mysqli_connect("mysql11.000webhost.com", "a7083778_user",      "abcd12734", "a70830778_data");
  
  $username = $_POST["username"];
  $password = $_POST["password"];
  
  $statement = mysqli_prepare($con, "SELECT * FROM user WHERE username = ? AND password = ?");
  mysqli_stmt_bind_param($statement, "ss", $username, $password);
  mysqli_stmt_execute($statement);
  
  mysqli_stmt_store_result($statement);
  mysqli_stmt_bind_result($statement, $userID, $name, $age ,$username, $password, $userPoints);
  
  $response = array();
  $response["success"] = false;  
  $_SESSION["userid"] = $userID;
  while(mysqli_stmt_fetch($statement)){
      $response["success"] = true;
  $response["userID"] = $_SESSiON["userid"]; 
      $response["name"] = $name;
      $response["age"] = $age;
      $response["username"] = $username;
      $response["password"] = $password;
  $response["userPoints"] = $userPoints;
  }
  
  echo json_encode($response);
   ?&gt;
  </code></pre>