Hello All!
I had a quick question about how I store some array data in my database and how I want to display it.
I have an app that basically requests users to enter a bid to get landscaping services done for numerous properties. How it works is that I first select which properties and then send them a bid request. The bidder then enters a price for each service for each store.
When I select which properties, it creates.
e.g. One bidder has 2 properties and they are required to enter their bids for the respective services. Once they submit, then it creates an array into my RetoolDB. There is a column for "Properties" and a separate column for "Bids" in my RetoolDB.
Below is the Property column and an example array:
[
{
"property": "1216",
"region": "Wisconsin",
"concept": "KK"
},
{
"property": "1294",
"region": "Texas",
"concept": "KF"
}
]
Below is how the BID array looks like. Notice how each key-value is in order so the :
[
{
"service 1": "95,10",
"service 2": "105,1",
"service 3": "125,1",
"service 4": "150,1",
"service 5": "100,10",
"service 6": "100,1",
"service 7": "50,1"
}
]
So If I wanted to query how much are the services for property 1294, I should get this below because 1294 is the second value in the array and I should get back the second value in the Bid Array (hope that makes sense):
[
{
"service 1": "10",
"service 2": "1",
"service 3": "1",
"service 4": "1",
"service 5": "10",
"service 6": "1",
"service 7": "1"
}
]
How can I for example write a query that will find the price of service 5 for property 1294? They are basically in order so the second or third value in the array should correspond to the second or third value for the bids.
Is that possible?
Thanks,