juniorcfdev
Programmer
hello all,
I have a junior developer seeking some help on a situation i have encountered.
I have a MS SQL database with a column that has a recordset that looks like this. This column is called the SkuList.
[[14,1,0000.jpg][1,4,0001.jpg][45,1,0005.jpg]]
This is the orders column from the orders table out of our database. Basicly what it means is someone is ordering the following.
qty 14 - sku 1 - photo 0000.jpg
qty 1 - sku 4 - photo 0001.jpg
qty 45 - sku 1 - photo 0005.jpg
It is a basic table with customer info as well as what photo they orders and how many.
My question today is how do i parse out data like that and use that data as a variable in coldfusion?
I know i can query out that whole string with the following query:
<CFQUERY DATASOURCE="#datasource#" NAME="getdata">
Select SkuList
from orders
where ID=2
</CFQUERY>
<CFOUTPUT QUERY="getdata">#SkuList#</CFOUTPUT>
That would output the whole sting depending on how many items the customer ordered.
What i need to do is parse the whole string out and create variables for each. so on a fullfillment page i could list each item ordered into seperate rows and columns for that customer.
qty 14 - sku 1 - photo 0000.jpg
qty 1 - sku 4 - photo 0001.jpg
qty 45 - sku 1 - photo 0005.jpg
Ontop of all that i have to query a seperate database on that sku number to get an item description, so i would image that each element of the string would have to have its own variable.
I have read and reread many things about arrays and structures, but i am still confused on how this whole thing works. Please if anyone is so kind would you mind helping out a really confused person.
Thanks in advance
I have a junior developer seeking some help on a situation i have encountered.
I have a MS SQL database with a column that has a recordset that looks like this. This column is called the SkuList.
[[14,1,0000.jpg][1,4,0001.jpg][45,1,0005.jpg]]
This is the orders column from the orders table out of our database. Basicly what it means is someone is ordering the following.
qty 14 - sku 1 - photo 0000.jpg
qty 1 - sku 4 - photo 0001.jpg
qty 45 - sku 1 - photo 0005.jpg
It is a basic table with customer info as well as what photo they orders and how many.
My question today is how do i parse out data like that and use that data as a variable in coldfusion?
I know i can query out that whole string with the following query:
<CFQUERY DATASOURCE="#datasource#" NAME="getdata">
Select SkuList
from orders
where ID=2
</CFQUERY>
<CFOUTPUT QUERY="getdata">#SkuList#</CFOUTPUT>
That would output the whole sting depending on how many items the customer ordered.
What i need to do is parse the whole string out and create variables for each. so on a fullfillment page i could list each item ordered into seperate rows and columns for that customer.
qty 14 - sku 1 - photo 0000.jpg
qty 1 - sku 4 - photo 0001.jpg
qty 45 - sku 1 - photo 0005.jpg
Ontop of all that i have to query a seperate database on that sku number to get an item description, so i would image that each element of the string would have to have its own variable.
I have read and reread many things about arrays and structures, but i am still confused on how this whole thing works. Please if anyone is so kind would you mind helping out a really confused person.
Thanks in advance