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


Recent Events
  • 23/11/2024 Black Friday 2024

    BIG SALE, 30% discount for all our extensions. Use BF24 coupon code. Hurry up the discount is valid till 3 December.

  • 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.


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?

SQL LIKE Predicate in Query Utilizing $REQUEST Var
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: SQL LIKE Predicate in Query Utilizing $REQUEST Var
#36408
SQL LIKE Predicate in Query Utilizing $REQUEST Var 11 Years, 9 Months ago Karma: 0
Hi -

Thanks to Ari-Soft's excellent support, I have the following functioning query:

SELECT
CompanyName,
City,
WEB
FROM
sheet4
WHERE
({$REQUEST:City|empty:''} = '' OR City = {$REQUEST:City|empty:''})
AND
({$REQUEST:Cuisine|empty:''} = '' OR cuisine = {$REQUEST:Cuisine|empty:''})
AND
({$REQUEST:Price Range|empty:''} = '' OR price = {$REQUEST:Price Range|empty:''})

I have modified my custom form to include a text box where user can input beginning portion of CompanyName
and would like to modify the query by including a LIKE predicate in the WHERE clause such as
WHERE
({$REQUEST:CompanyName|empty:''} LIKE '' OR CompanyName LIKE {$REQUEST:City|empty:''})
AND
.....(rest of original query).

Is this possible to do and if so, could you provide me the proper syntax for accomplishing same?

Thanking you in advance as always for your excellent support.
The administrator has disabled public write access.
 
#36409
Re:SQL LIKE Predicate in Query Utilizing $REQUEST Var 11 Years, 9 Months ago Karma: 760
Hello,

Use the following:


WHERE
({$REQUEST:CompanyName|empty:''} = '' OR CompanyName LIKE CONCAT({$REQUEST:CompanyName|empty:''}, '%'))
AND
.....(rest of original query)


Regards,
ARI Soft
The administrator has disabled public write access.
 
#36410
Re:SQL LIKE Predicate in Query Utilizing $REQUEST Var 11 Years, 9 Months ago Karma: 0
Hi -

Thanks again for your assistance, you guys are the greatest, worked like a charm
Last Edit: 2013/02/03 18:48 By tmediacom.
The administrator has disabled public write access.
 
Go to topPage: 1