can't define id ( cold fusion )

Posted by venom on Stack Overflow See other posts from Stack Overflow or by venom
Published on 2011-01-11T14:03:56Z Indexed on 2011/01/11 23:54 UTC
Read the original article Hit count: 185

Filed under:

here is my cold fusion code:

Example1:

<cfquery name="GET_BRAND" datasource="#dsn1#">
SELECT PRODUCT_CATID 
FROM PRODUCT_CAT 
WHERE PRODUCT_CATID = PRODUCT_CATID
</cfquery>
#get_brand.product_catid#

But it shows all the time number 1, i just can't understand why, and how do i make it work properly, this code should have defined the brand_id, but instead shows 1. The system is Workcube.

Here is my example for getting from the static product's id, its dynamic price:

Example 2:

<cfset product_id = 630>
            <cfquery name="price_standart" datasource="#dsn3#">
            SELECT
                PRICE_STANDART.PRICE PRICE
            FROM
                PRICE_STANDART
            WHERE
                PRICE_STANDART.PRODUCT_ID = 
                <cfqueryparam value="#product_id#" cfsqltype="cf_sql_integer">
            </cfquery>

But this time i need to get from dynamic product's ID its dynamic brand id. This script works the same way as the Example 1:

<cfquery name="GET_BRAND" datasource="#dsn1#">
                        SELECT BRAND_ID 
                        FROM PRODUCT_BRANDS
                        WHERE BRAND_ID = BRAND_ID
                        </cfquery>
                        #get_brand.BRAND_ID#

© Stack Overflow or respective owner

Related posts about coldfusion