title: how to store mysql select statement inside php variable using mysqli
body: <p>I know this has been asked before but I cant seem to fix my code.
  What I need is to run some php code to query mysql using mysqli for a select statement to retrieve my bcrypt hashed pass so I can compare the user input with the user hashed password. NOTE: I have not yet added mysql_real_escape_string to my $POST variables. </p>
  
  <p>I've changed this code a thousand times still cant get it.
  Ive even copy and pasted to a new file a simple query script using num_row 
           and printf($row['pass']); used echo etc..... I've used fetch array ive tried almost everything I've been all via php mysql at php.net w3c.com etc etc is my system broke? Does mysqli have a bug ? and no i dont want to switch to PDO I wont stop til this is fixed and when there is no longer sql injection vulns 
  Heres my code:</p>
  
  <pre><code>&lt;?php
      $conn = new mysqli('localhost', 'root', '', 'social');
      if (mysqli_connect_errno())
      {
          exit("connection failed" . mysqli_connect_error());
      }
      else
      {
          echo "connection established";
      }
      $db=mysqli_select_db( $conn,'social');
  
      if ($_POST &amp;&amp; isset($_POST['submit'], $_POST['password'], $_POST['email']))
      {
          $pass = ($_POST["password"]);
          $email =($_POST["email"]);
  
          $bcrypt = password_hash($pass, PASSWORD_BCRYPT, array('cost' =&gt;  12));
      }
      $query = "SELECT `pass` FROM `social` WHERE `email` = 'jargon@jargon'";
      $fetcher = mysqli_fetch_assoc($query);
      echo $fetcher;
  
      if ($conn-&gt;query($fetcher) === TRUE)
      {
          echo "query has gone through now we need to store the hash&lt;br /&gt; for comparison";
      }
      else
      {
          echo "error did not retrieve hash info";
      }
  </code></pre>