\Illuminate\Database\QueryException

未匹配的标注

\Illuminate\Database\QueryException

介绍

在 Laravel 中执行数据库查询出错时就会抛出 \Illuminate\Database\QueryException 异常

namespace Illuminate\Database
class QueryException extends PDOException

成员方法

可用的成员方法只有两个

方法名 说明
\Illuminate\Database\QueryException::getSql() 返回执行的 SQL 语句
\Illuminate\Database\QueryException::getBindings() 返回 SQL 语句绑定的参数

\Illuminate\Database\QueryException::getSql()

/**
 * Get the SQL for the query.
 *
 * @return string
 */
public function getSql()
{
    return $this->sql;
}

\Illuminate\Database\QueryException::getBindings()

/**
 * Get the bindings for the query.
 *
 * @return array
 */
public function getBindings()
{
    return $this->bindings;
}

本文章首发在 LearnKu.com 网站上。

上一篇 下一篇
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
讨论数量: 0
发起讨论 只看当前版本


暂无话题~