Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database & Arrays

Status
Not open for further replies.

anastasia

Programmer
Dec 13, 2000
111
GB
Hi, I am new to using Cold Fusion and have aproblem whcih I quite stuck on. I have an Array and it holds an id in element [1][1] and so on more id's get added. I can get this information from the array and display it on screen by using #session.basket[rowCount][1]# this displays the id's in a table row. I have in a database the id andd related info the info is on a product. I want to be able to get this info from the database based on the act that the id's in the Array much the id's in the database and then only these records from the database appear.

Any help would be great.

Thank you.
 
loop over your array
for each row of the array, if the id is in the db then display its value

done !
 
Thank you iza for your reply. Since I put up this message I have got the data from the database and put it into the array. Knaow I show the records in the Array within a table. I have also got it adding up the price for each product by multiplying the price with the quantity. However this wasn't straight forwad as I have included several IF statements as the price changes due to the amount of products purchased. I do however now have the problem of adding up all the prices for a sub-total. This is made more difficult due to the fact of the IF statements implemented.

Anyway thanks again for your reply.

Bye

Anastasia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top