|
Marlon,
Here
is the latest version of the code:
<CFLOOP Index="i" From="1"
To="#ArrayLen(SESSION.Cart)#">
<CFIF SESSION.Cart[1] IS #model#> <CFSET Position = i> <CFBREAK> </cfif> </cfloop> <cfparam name="position"
default="ArrayLen(session.cart) + 1" >
<CFIF Position LT
ArrayLen(session.cart)>
<cfset session.cart[position][4]=session.cart[position][4] + form.quantity> <CFELSE> <cfquery name="get_products" datasource="#dsn#" dbtype="ODBC"> select * from products where model='#model#' </cfquery> <cfset session.cart[position][1]="#get_products.model#"> <cfset session.cart[position][2]="#get_products.header#"> <cfset session.cart[position][3]="#get_products.price#"> <cfset session.cart[position][4]="#form.quantity#"> </cfif> I keep
getting this error:
An error occurred while evaluating the expression: session.cart[position][1]="#get_products.model#"Error near line 46, column 29. The expression specifying dimension 1 of the object session.cart is not an integer expression. Only integer expressions can be used to index objects. - Gary
|
Title: Array help...
- RE: Array help... Houk, Gary
- Re: Array help... Marlon Moyer
- RE: Array help... Houk, Gary
- Re: Array help... Marlon Moyer
- Re: Array help... Houk, Gary
- Re: Array help... Marlon Moyer
