SQLite3::querySingle() - sqlite3数据库类
SQLite3::querySingle()
(PHP 5 >= 5.3.0, PHP 7)
Executes a query and returns a single result
说明
publicSQLite3::querySingle(string $query[,bool $entire_row=FALSE
]): mixedExecutes a query and returns a single result.
参数
$queryThe SQL query to execute.
$entire_row By default,querySingle() returns the value of the first column returned by the query. If$entire_rowis TRUE
, then it returns an array of the entire first row.
返回值
Returns the value of the first column of results or an array of the entire first row(if$entire_rowis TRUE
).
If the query is valid but no results are returned, then NULL
will be returned if$entire_rowis FALSE
, otherwise an empty array is returned.
Invalid or failing queries will return FALSE
.
范例
SQLite3::querySingle() example
以上例程的输出类似于:
string(5) "Scott" Array ( [username] => Scott [email] => scott@example.com )
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!