title: Passing data from `HTML` Login form to `PHP` for data retrivel from `MySQL' database
body: <p>The below is the code of the PHP file that I creaed.</p>
  
  <pre><code>&lt;?php
  $db = mysqli_connect("127.0.0.1","root","toor","mylib")
  or die('Error connecting to MySQL server.');
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;h1&gt;PHP connect to MySQL&lt;/h1&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  
  &lt;?php
  $query = "SELECT * FROM book WHERE bookid IN  (SELECT bookid FROM studentbook  WHERE studid =
  $_POST['stuid'])";
  mysqli_query($db, $query) or die('Error querying database.');
  $result = mysqli_query($db, $query);
  $row = mysqli_fetch_row($result);
  foreach($row as $a)
      print($a." ");
  ?&gt;
  </code></pre>
  
  <p>Now, I am looking to get <code>studid</code> from HTML login page and passing it 
  to the PHP file using <code>POST</code> method to retrieve data corresponding to the value(studid) entered, from <code>MySQL</code> database - I mean using <code>mysqli_query()</code> function.</p>
  
  <p>But when I try to run the code which I have shown above, I came up  with below <code>Error</code>:</p>
  
  <p><code>Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /opt/lampp/htdocs/connectivity.php on line 13</code></p>
  
  <p><strong>Please guide me on the following:</strong></p>
  
  <p>1) How to get values from <code>Login page</code> and pass it to the <code>PHP file</code> using <code>post</code> method?</p>
  
  <p>2) How to correct the above mentioned error?</p>