IATA and ICAO

GRATUIT
Par leopieters | Mise à jour il y a 5 mois | Travel
Popularité

0.4 / 10

Latence

477ms

Niveau de service

100%

Retour à toutes les discussions

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

A
abhig01
il y a 4 ans

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
            )
    )

Participez à la discussion - ajoutez un commentaire ci-dessous:

Connectez-vous / Inscrivez-vous pour publier de nouveaux commentaires
Note : 2.6 - Votes : 5