title: stored procedure returns empty result
body: <p>Below is my stored procedure:</p>
  
  <pre><code>DELIMITER $$
  --
  -- Procedures
  --
  DROP PROCEDURE IF EXISTS `checkLogin`$$
  CREATE DEFINER=`root`@`localhost` PROCEDURE `checkLogin`(IN `uname` VARCHAR(255), IN `pwd` VARCHAR(255))
  BEGIN
      SELECT a.id, a.role_id, b.name FROM userTable as a
      LEFT JOIN roleTable as b on b.id = a.role_id 
      WHERE a.username = uname AND password = pwd;
  END$$
  
  DELIMITER ;
  </code></pre>
  
  <p>Below is my execution code:</p>
  
  <pre><code>    $stmt = $this-&gt;dbCon-&gt;prepare("CALL checkLogin(?, ?)");
  
      $stmt-&gt;bindParam(1, $email, PDO::PARAM_STR, 4000); 
      $stmt-&gt;bindParam(2, $password, PDO::PARAM_STR, 4000); 
  
      // call the stored procedure
      $stmt-&gt;execute();
  
      //var_dump($res);
      $op = ( $stmt ) ? $stmt-&gt;fetchAll(PDO::FETCH_ASSOC) : '';
  
      echo '&lt;pre&gt;'; print_r($op); die;
  </code></pre>
  
  <p>in the above <code>$this-&gt;dbCon</code> is my PDO object.</p>
  
  <p>When I execute this code I am getting only empty result. But when I run the procedure through phpmyadmin it is working fine.</p>
  
  <p>Even it is working fine if I execute through command line:</p>
  
  <p><img src="https://i.stack.imgur.com/hIrnI.png" alt="enter image description here"></p>
  
  <p>I tried below method also (Received from Answer), But still its unsuccessful</p>
  
  <pre><code>$stmt = $db-&gt;prepare("Call checkLogin(?,?);");
  $stmt-&gt;execute(array($email,$password));
  
  $rows = $stmt-&gt;fetchAll(PDO::FETCH_ASSOC);
  
  if (count($rows) == 0)
      echo 'Failed Login!'."\n";
  else
      echo 'Logged In...'."\n".print_r($rows,true);
  </code></pre>