【发布时间】:2019-08-12 09:33:14
【问题描述】:
我已经测试了这个Firebase Filtering data with PHP,但我得到了这个错误,我不知道如何调试这个
致命错误:未捕获的 GuzzleHttp\Exception\ClientException:客户端 错误:
GET https://table.firebaseio.com/tbl_admin?orderBy=%22username%22&equalTo=%22admin%22&limitToFirst=1导致400 Bad Request响应:{“错误”:“索引不 已定义,添加 \".indexOn\": \"username\", for path \"/tbl_admin\", to 规则”}在 D:\Xampp\htdocs\firebase\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113 堆栈跟踪:#0 D:\Xampp\htdocs\firebase\vendor\guzzlehttp\guzzle\src\Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), 对象(GuzzleHttp\Psr7\Response))#1 D:\Xampp\htdocs\firebase\vendor\guzzlehttp\promises\src\Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response))2 D:\Xampp\htdocs\firebase\vendor\guzzlehttp\promises\src\Promise.php(156):
GuzzleHttp\Promise\Promise::callHandler(1, 对象(GuzzleHttp\Psr7\Response),数组)#3 D:\Xampp\htdocs\firebase\vendor\guzzlehttp\promises\src\TaskQueue.php(47): GuzzleHttp\Prom in D:\Xampp\htdocs\firebase\vendor\kreait\firebase-php\src\Firebase\Exception\QueryException.php 第 28 行
我将如何在 firebase 上过滤它,因为我在 mysql 上这样查询它:
SELECT * FROM tbl_admin WHERE username = 'admin'
【问题讨论】:
-
内嵌图片,让用户不必离开 StackOverflow
标签: php mysql firebase firebase-realtime-database