EasyCFM.COM ColdFusion Forums / ColdFusion Applications / how to approach this problem

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: how to approach this problem

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

04-20-2009 @ 12:00 AM
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 2
Joined: Apr 2009

        I am displaying a dynamic table  which consits of four columns named as Ingredient,Lot,d_amount,d_unit......out of which Ingredient,d_amount,d_unit are taken from one

query named as "qrecipes" i.e from one table and Lot Cloumn is taken from another table.Now the problem is the data that is to be displayed in lot column is dependent on the

data present in ingredient.i.e If the first row ingredient column has "XYZ" then i need to pick the id of "XYZ" from second table and display in lot column.

              Ingredient   Lot            d_amount     d_unit

         1   xyx       345 is id
                           for XYZ which
                          should be
               displayed from
               Second table

Below is my code ....please say what is wrong .....please suggest me if there are any other methods or any kind of solution to solve this problem


<cfquery name="qrecipes" datasource="testmsexcell">
FROM Recipes WHERE product='#form.product#'


<cfquery name="qlot"  datasource="testmsexcell">
SELECT Lots.id
FROM Lots WHERE ingredient='#qrecipes.ingredient#'


                               table border="2px" id="maketable">
                                    <cfoutput query="qrecipes">
                                        <td><cfselect name="lotid" id="lotid" query="qlot" value="id" display="id"></cfselect></td>

Website Designed and Developed by Pablo Varando.