IATA and ICAO

無料
よって leopieters | 更新済み 4 days ago | Travel
人気

0.4 / 10

レイテンシー

1,785ms

サービスレベル

100%

Health Check

N/A

すべてのディスカッションに戻る

Keep getting `SQLSTATE[42000]: Syntax error or access violation` error

Rapid account: Abhig 01
abhig01
6 years ago

Below is my code

	Unirest\Request::verifyPeer(false);
	$response = Unirest\Request::get("https://leopieters-iata-and-icao-v1.p.mashape.com/airportDatabase?codeIataAirport=BOM&key='".MASHAPE_IATA_CODE_API_KEY."'",
		array(
			"X-Mashape-Key" => MASHAPE_IATA_CODE_API_KEY,
			"Accept" => "text/plain"
		));

	print_r($response);

Here is the response

    Unirest\Response Object
    (
        [code] => 200
        [raw_body] => {"error": {"text": SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{key}''' at line 1}
        [body] => {"error": {"text": SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{key}''' at line 1}
        [headers] => Array
            (
                [0] => HTTP/1.1 200 OK
                [Access-Control-Allow-Headers] => X-Requested-With, Content-Type, Accept, Origin, Authorization
                [Access-Control-Allow-Methods] => GET, POST, PUT, DELETE, OPTIONS
                [Access-Control-Allow-Origin] => *
                [Content-Type] => text/html; charset=UTF-8
                [Date] => Sat, 03 Feb 2018 06:46:51 GMT
                [Host-Header] => 192fc2e7e50945beb8231a492d6a8024
                [Server] => Mashape/5.0.6
                [X-Proxy-Cache] => MISS
                [Content-Length] => 274
                [Connection] => keep-alive
            )
    )

ディスカッションに参加しましょう-以下にコメントを追加してください:

ログイン/サインアップして新しいコメントを投稿