异常' PDOException' with message' SQLSTATE [HY000]:一般错误:2053用于存储过程调用Laravel 5.4

时间:2017-11-23 12:59:53

标签: php pdo laravel-5.4

我正在尝试调用过程,但我收到了我提到的错误。

  

例外' PDOException'消息' SQLSTATE [HY000]:常规错误:   2053

以下行是指向错误的内容。

  

$ result_new = $ this-> result-> fetchAll(PDO :: FETCH_CLASS);

  public function getProcResult($returnKeys = array() ){

            $rows = array();
            $this->result = $this->selectprc();
            $columns = array();
            $key_count = 0;
            $first_call = true;
            do{
                $result_new = $this->result->fetchAll(PDO::FETCH_CLASS);//this is where i am getting the error
                if(isset($returnKeys[$key_count])) {
                    if (count($result_new)) {
                        //print_r($result_new);
                        //echo  $returnKeys[$key_count];
                        //echo '<br>=========<br>';
                        $this->data[$returnKeys[$key_count]] = $result_new;
                    } else {
                        $this->data[$returnKeys[$key_count]] = array();
                    }
                }
                $key_count++;
            }while($this->result->nextRowset());

            do{
                if(isset($returnKeys[$key_count])) {
                    $this->data[$returnKeys[$key_count]] = array();
                }
                $key_count++;
            }while($key_count<count($returnKeys));

            return $this;

        }

   protected  function  selectprc(){
            $pdo = DB::connection($this->connection)->getPdo();
            DB::connection()->logQuery($this->query,array());
            return $pdo->query($this->query);
        }

0 个答案:

没有答案