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?

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, 5 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, 5 Months ago Karma: 748
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, 5 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