title: PDOstatement::execute() expect parameter 1 to be array, string given in
body: <p>Please help me to correct this code.
  error at line </p>
  
  <pre><code>$stmt-&gt;execute($params = [], $query);
  </code></pre>
  
  <p>and when i open the file with dreamweaver every "$params=[]" is error.</p>
  
  <p>-Databasse.php-</p>
  
  <pre><code>&lt;?php 
  
  include_once('connection.php'); //my connection is here
  
  class Database extends connection{
  
  
  public function __construct(){
  
      parent::__construct();
  }
  
  public function getRow($params = [], $query){
      try {
          $stmt = $this-&gt;datab-&gt;prepare($query);
          $stmt-&gt;execute($params);
          return $stmt-&gt;fetch();  
      } catch (PDOException $e) {
          throw new Exception($e-&gt;getMessage());  
      }
  
  }
  
  public function getRows($query, $params = []){
      try {
          $stmt = $this-&gt;datab-&gt;prepare($query);
          $stmt-&gt;execute($params);
          return $stmt-&gt;fetchAll();   
      } catch (PDOException $e) {
          throw new Exception($e-&gt;getMessage());  
      }
  }
  </code></pre>
  
  <p>this is half of the source code database.php</p>