0


I think i have reached a dead end with this one... I am trying to retrieve Blob from database using cUrl (in php). The flow looks like following
PHP (cUrL) -> 'url request' -> Rest API -> Database -> Rest -> array in PHP.

I have seen quite a few examples how to do it with direct SQL query but in what i am doing this it not the case. Below you can see how json data representation of the object in question.

"id": "f8fd460f-49a3-4f8b-91f9-5de8200b79e3",
    "insertedOn": "2012-12-01T18:57:17Z",
    "updatedOn": "2012-12-01T18:57:17Z",
    "identifier": "VirtuconAdapter@3238808399@2012-12-01T18:57:17.648+0000",
    "messageId": "0000c62a-f5bc-4900-8b46-7de4164abf09",
    "payloadSizeBytes": 0,
    "payload": "Cgo8P3htbCB2ZXJzaW9uPSIxLjAiPgo8RG9jdW1lbnQ+CiAgPExpbmU+VGhlIFNreW5ldCBGdW5kaW5nIEJpbGwgaXMgcGFzc2VkLjwvTGluZT4KICA8TGluZT5UaGUgc3lzdGVtIGdvZXMgb24tbGluZSBBdWd1c3QgNHRoLCAxOTk3LjwvTGluZT4KICA8TGluZT5IdW1hbiBkZWNpc2lvbnMgYXJlIHJlbW92ZWQgZnJvbSBzdHJhdGVnaWMgZGVmZW5zZS48L0xpbmU+CiAgPExpbmU+U2t5bmV0IGJlZ2lucyB0byBsZWFybiBhdCBhIGdlb21ldHJpYyByYXRlLjwvTGluZT4KICA8TGluZT5JdCBiZWNvbWVzIHNlbGYtYXdhcmUgYXQgMjoxNCBhLm0uIEVhc3Rlcm4gdGltZSwgQXVndXN0IDI5dGguPC9MaW5lPgogIDxMaW5lPkluIGEgcGFuaWMsIHRoZXkgdHJ5IHRvIHB1bGwgdGhlIHBsdWcuPC9MaW5lPgo8L0RvY3VtZW50PgoK",
    "metadata": {
        "source": "CyberdyneEngineering",
        "adapter_id": "VirtuconAdapter",
        "messageType": "T1000",
        "payloadIdentifier": "VirtuconAdapter@3238808399@2012-12-01T18:57:17.648+0000",
        "timestamp": "@2012-12-01T18:57:17.648+0000",
        "transactionRef": "REF1985300039",
        "hubItinerary": "CyberdyneAdapter",
        "destination": "VirtuconEngineering",
        "messageuniqueid": "0000c62a-f5bc-4900-8b46-7de4164abf09",
        "randomString": "@3238808399",
        "adpnextmlemarkersequence": "24",
        "documentTrackingId": "D0198556465",
        "routingDestination": "client.VirtuconAdapter.receive"
    }

So now the key would be to get this whole metadata array (which is blob)into something in php. hopefully i explained the problem well.

Thank for looking and help

3
  • I presume payload is the blob? Commented Oct 15, 2013 at 15:23
  • @MarcB Actually the metadata is blob. This json object is key - value pair map Commented Oct 15, 2013 at 15:33
  • please provide your PHP code. Commented Oct 15, 2013 at 22:03

1 Answer 1

1

If i'm understanding you correctly, you've stored that entire json object in SQL as your blob, and you've just pulled it out of the DB using PHP.

At that point, you'll have a string of json. What's stopping you from performing a json_decode method on that string?

Sign up to request clarification or add additional context in comments.

1 Comment

Yes i have realised that yesterday that i could just do json_decode(foo, true) and that will return me array. But anyway thx for answer :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.