Well for instance, World of Warcraft uses item ID’s.
Every inventory slot has a value - either null or an item ID.
Save your item ID’s as strings and save Item data on the server.
Then the player gets all ID’s for each inv slot from the database and via the server the client gets information on items with corresponding IDs.
Just have your server-side PHP use echo to write out a string in a format you’re ready to parse. For example, have it write out a simple XML string, then when you pull that with WWW.data you can parse the string and use the parsed data to build your inventory list. Of course using XML isn’t strictly necessary, it could be that you just write out a comma delimited list then break that up upon retrieval.
But the basic point is this: WWW.data is only ever going to get you a string back from your PHP file, you just need to work that string into your desired format after retrieval, it’s just basic string manipulation work and you can slice it dozens of ways so find one that suits you!
Yes, I have a sample project you can look at for reference, although it pulls a simple XML file and parses that as an array of planets (or bodies), each with its own set of data. It’s an orbital motion simulator with a mini-XML parser I wrote that should serve as an example from which you can build on as it:
Shows how to use the WWW class to pull a file.
How to write a simple parsing routine to read the results and build an array out of them.
The whole simulation is configured by reading in an external XML file so it’s all data driven. For reference, here is the XML that I read in to the demo above:
Notice that the “system” as a whole has some properties, then it also has a list of “bodies”, and each “body” has its own data associated with it. In your case instead of a system it would be an “inventory” and instead of having barious “bodies” you’d have “items” each of which would have properties (like item type, perhaps a value, etc.).
From there you should be able to sort things out well enough, good luck!