Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Use $SESSION instead of $REQUEST variables
(1 viewing) (1) Guest
Go to bottomPage: 123
TOPIC: Use $SESSION instead of $REQUEST variables
#58636
Re:Use $SESSION instead of $REQUEST variables 7 Years, 7 Months ago Karma: 748
Use {$PHPSESSION} instead of {$SESSION}. {$SESSION} variables are used for Joomla! sessions, Joomla! is configured to store sessions into database on your site.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#58646
Re:Use $SESSION instead of $REQUEST variables 7 Years, 7 Months ago Karma: 0
Thank you. Works great now.

Ken
The administrator has disabled public write access.
 
#58696
Re:Use $SESSION instead of $REQUEST variables 7 Years, 7 Months ago Karma: 0
One more question as I work through developing the changes required in this upgrade. The overall aim of these changes is to now support multiple selections and return with ARIDataTables results for queries with multiple selections.

For the single selection, here is what I am using in the ARIDataTables SQL query,

AND ({$REQUEST:vACClass|empty:""} = '' OR ACClass LIKE CONCAT({$REQUEST:vACClass|empty:""},'%'))
AND

The above is part of the WHERE and the selected values to drive the filter is passed via the URL as a $REQUEST variable. This works great.

Now, for the new multi-select query I am testing, below is what I have for the same filtering field,

AND
({$PHPSESSION:sACClass|empty:""} = '' OR ACClass IN ( {$PHPSESSION:sACClass|empty:""} ))
AND

The selected items are in a string saved as a $SESSION variable named sACClass which is simply the selected values separated by a COMMA. The ACClass is the database field being queried.

The new method above works fine when nothing is selected, and when only one item is selected. However, when more than one item is selected ARIDataTables returns no data from the database.

Clearly, I am missing something, but have not been able to isolate the problem. Do you have any ideas or suggestions? I am sure I am doing something wrong.

Also, I have confirmed that the $SESSION variables are filling properly.

Ken
The administrator has disabled public write access.
 
#58700
Re:Use $SESSION instead of $REQUEST variables 7 Years, 7 Months ago Karma: 748
It doesn't work because value of {$PHPSESSION:sACClass} is a string, not an array. IN operator for multiple values look like:

Col1 IN ('Value 1', 'Value 2', 'Value 3')

in your case it looks like:

Col1 IN ('Value 1,Value 2,Value 3')

BTW, the extension doesn't support ability to use array variables. We can extend this functionality and implement it as a custom feature.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#58703
Re:Use $SESSION instead of $REQUEST variables 7 Years, 7 Months ago Karma: 748
It will not work because the extension doesn't support variable which contains arrays. As we wrote previously, we can adjust module functionality and add it as a custom feature. If you are interested in it, contact us by email and we will discuss details.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#58706
Re:Use $SESSION instead of $REQUEST variables 7 Years, 7 Months ago Karma: 0
I sent you the email requesting details on supporting array variables.

But I am still confused by your replies. I am not using any array variables in my implementation.

The variable sACClass is NOT an array, it is a string that is built from an array outside of the module. The array is not referenced anywhere in the ARIDataTables module. I am attempting to build a string to pass the set of acceptable values for the IN statement.

Is there another way to achieve the same result other than using an IN statement? Maybe what I am building for the IN is the same as an ARRAY, as far as ARIDataTables is concerned.

I do not see how passing a string into the IN is an array, but what do I know. The IN is standard SQL.

I am simply trying to implement multiple selections in the easiest way possible. My first thought was to use the power of SQL which your extension supports.

Ken
The administrator has disabled public write access.
 
Go to topPage: 123