original_string: public function run ($query, $bind=[]) {
          try {
              $this->handle = $this->prepare($query);
              $this->handle->execute($bind);
  
              // check what the query begins with
              if (preg_match('/^(select|describe|pragma)/i', $query)) {
                  // return a result set
                  return $this->handle->fetchAll();
              }
  
              if (preg_match('/^(delete|insert|update)/i', $query)) {
                  // return the affected row count
                  return $this->rowCount();
              }
  
              // default to simply indicating success
              return true;
          } catch (\PDOException $e) {
              $this->error = $e->getMessage();
              return false;
          }
      }
code: public function run ($query, $bind=[]) {
          try {
              $this->handle = $this->prepare($query);
              $this->handle->execute($bind);
  
              // check what the query begins with
              if (preg_match('/^(select|describe|pragma)/i', $query)) {
                  // return a result set
                  return $this->handle->fetchAll();
              }
  
              if (preg_match('/^(delete|insert|update)/i', $query)) {
                  // return the affected row count
                  return $this->rowCount();
              }
  
              // default to simply indicating success
              return true;
          } catch (\PDOException $e) {
              $this->error = $e->getMessage();
              return false;
          }
      }
code_tokens: public function run ( $ query , $ bind = [ ] ) { try { $ this -> handle = $ this -> prepare ( $ query ) ; $ this -> handle -> execute ( $ bind ) ; // check what the query begins with if ( preg_match ( '/^(select|describe|pragma)/i' , $ query ) ) { // return a result set return $ this -> handle -> fetchAll ( ) ; } if ( preg_match ( '/^(delete|insert|update)/i' , $ query ) ) { // return the affected row count return $ this -> rowCount ( ) ; } // default to simply indicating success return true ; } catch ( \ PDOException $ e ) { $ this -> error = $ e -> getMessage ( ) ; return false ; } }
docstring: Execute any SQL query
  
  To ensure your query is safe from first order SQL injection attacks pass all values via the $bind array
  
  @param  string $query MySQL query
  @param  array $bind  key:value pairs where the key is a bind identifier and value is to be inserted at that location
  @return mixed see example
  @example depending on the type of input query the returned result can be an affected row count or a result set, the type of which is specified in the options passed to the constructor, defaulting to an assoc array
  @example $query = 'SELECT * FROM table_name WHERE col_id = :BindColID'; $bind = [':BindColID' => 12];
docstring_tokens: Execute any SQL query