Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
{
    "success": true,
    "response": {
        "colWidths": [
            41,
            7
        ],
        "results": [
            {
                "00001": "Alpineaire Food, 58",
                "CATID": "58"
            },
            {
                "00001": "Altimiters, 13",
                "CATID": "13"
            },
            {
                "00001": "Avalanche Gear, 82",
                "CATID": "82"
            }
        ]
    }
}

PHP Error Example

Code Block

 // Example of error reporting.
    $con = db2_connect(DB, USER, PASS, array("i5_naming" => DB2_I5_NAMING_ON));
    if (!$con) {
    
      $response = array(
      
        "success" => false,
        "errorId" => db2_conn_error(),
        "errorText" => db2_conn_errormsg()
      
      );
      
      print json_encode($response);
      return;
    
    }

JSON Error Example

This is the information returned using JSON format formatting to report an error with an auto-complete textbox. This was passed from the example above.

Code Block
{
    "success": false,
    "errorId": "08001",
    "errorText": "Authorization failure on distributed database connection attempt. SQLCODE=-30082"
}

...