Warning: count(): Parameter must be an array or an object that implements Countable in C:\OSPanel\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 67
Fatal error: Uncaught Google_Service_Exception: { "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "errors": [ { "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "domain": "global", "reason": "unauthorized" } ], "status": "UNAUTHENTICATED" } } in C:\OSPanel\vendor\google\apiclient\src\Google\Http\REST.php:118 Stack trace: #0 C:\OSPanel\vendor\google\apiclient\src\Google\Http\REST.php(94): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttp\Psr7\Response), Object(GuzzleHttp\Psr7\Request), 'Google_Service_...') #1 C:\OSPanel\vendor\google\apiclient\src\Google\Task\Runner.php(181): G in C:\OSPanel\vendor\google\apiclient\src\Google\Http\REST.php on line 118
$search_name = $_GET['search-text'];
$search_name = explode(" ", $search_name);
foreach ($search_name as $key => $value) {
if (isset($search_name[$key - 1])) {
echo $query = ' OR ' . 'service_name' . ' = ' . $value;
}else{
echo $query = $value;
}
}
$number_of_pages = ceil($nresult_num/$results_per_page);
$this_page_first_result = ($page-1)*$results_per_page;
$rs = $pdo->prepare("SELECT * FROM services WHERE service_name = ? LIMIT " . $this_page_first_result . ',' . $results_per_page);
$rs->execute(array($query));
$fetch = $rs->fetchAll();
$result_num = $rs->rowCount();
}