title: bind_param with two or more parameters php
body: <p>i have class <strong>Database</strong> and database get two methods</p>
  <pre><code>public function select($query = &quot;&quot; , $params = [])
      {
          try {
              $stmt = $this-&gt;executeStatement( $query , $params );
              $result = $stmt-&gt;get_result()-&gt;fetch_all(MYSQLI_ASSOC);             
              $stmt-&gt;close();
  
              return $result;
          } catch(Exception $e) {
              throw New Exception( $e-&gt;getMessage() );
          }
          return false;
      }
  
  
  private function executeStatement($query = &quot;&quot; , $params = [])
  {
      try {
          $stmt = $this-&gt;connection-&gt;prepare( $query );
  
          if($stmt === false) {
              throw New Exception(&quot;Unable to do prepared statement: &quot; . $query);
          }
  
          if( $params ) {
              $stmt-&gt;bind_param($params[0], $params[1]);
          }
  
          $stmt-&gt;execute();
  
          return $stmt;
      } catch(Exception $e) {
          throw New Exception( $e-&gt;getMessage() );
      }   
  }
  </code></pre>
  <p>and in my Model y have this</p>
  <pre><code> public function signIn($userName,$password){
          return $this-&gt;select(&quot;select count(*) as o_user_exists from users where username = ? and password = ? &quot;, [&quot;i&quot;,$userName,$password]);                    
      }
  </code></pre>
  <p>but not work, only work to 1 parameters but two dont working</p>
  <p>i read this post <a href="https://www.php.net/manual/es/mysqli-stmt.bind-param.php" rel="nofollow noreferrer">https://www.php.net/manual/es/mysqli-stmt.bind-param.php</a> but i can't decipher the syntax</p>