Forum Moderators: coopster & phranque

Message Too Old, No Replies

ColdFusion Variables

Variables don't work when drilling down.

         

carmo

2:15 am on Dec 22, 2001 (gmt 0)



I made a CFM page that diplays something that looks like this:

PRODUCTS:

Product Name: Dreamweaver
Product Price: 199.99$
Quantity: 4
More Info

Product Name: Fireworks
Product Price: 199.99$
Quantity: 6
More Info

"More Info" is a link <a href = "more_info.cfm?id = #product_id#">More Info</a>

Now, The More Info page extracts more data of the product from the database. The top of the more_info.cfm page looks like this:

<CFQUERY name = "get_info" datasource = "product">
select * from products_table where product_id = #id#
</CFQUERY>

NOW, For some reason, when I run this on the server...I get an error for the "id" variable. It doesn't recognize it for some reason. BUT if I replace the id variable with an actual value (ex. 3) ..it will work. Anyone know what the problem is. Thanks

Cheers,
carmo

justa

12:15 am on Dec 24, 2001 (gmt 0)

10+ Year Member



Try putting the value in "quote's"

Slade

11:00 pm on Dec 24, 2001 (gmt 0)

10+ Year Member



When you click on this link, or when the page containing it loads, what does the actual link look like?

(Show us the resultant link. Not what you think it is, what it actually resolves to.)

PS: Spaces are bad.

tmollerus

10:52 pm on Jan 31, 2002 (gmt 0)



First of all, adding a scope reference is always a good idea-- it makes the variable get resolved faster, it's friendlier for you or another developer to work with. So try to use #URL.id# instead of just #id#.

Second, it may be a good idea to initialize the variable with <CFPARAM> or to test for it with the IsDefined() function.

justa

11:39 pm on Feb 5, 2002 (gmt 0)

10+ Year Member



Are you using ColdFusion Studio?