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?

[SOLVED] How to use LIKE in mySql?
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: [SOLVED] How to use LIKE in mySql?
#56284
[SOLVED] How to use LIKE in mySql? 8 Years, 5 Months ago Karma: 1
Hello

How to properly write LIKE syntax if I want to display all rows where mycolumn contains specific phrase?

I tried examples from here: stackoverflow.com/questions/2602252/mysql-query-string-contains

But module always throws error.

I guess that I need ARI specific escaping?

Thanks,
Regards
Krx
User Offline Click here to see the profile of this user
Last Edit: 2015/11/17 14:06 By Krx.
The administrator has disabled public write access.
 
#56285
Re:How to use LIKE in mySql? 8 Years, 5 Months ago Karma: 747
Hello,

What query do you use?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#56286
Re:How to use LIKE in mySql? 8 Years, 5 Months ago Karma: 1
SELECT
id,
b_ref_id,
add_date,
last_modified_time_stamp
FROM
vit2_rpl_properties
WHERE
description_hr_hr
LIKE
%{$MsoNormalTable}%

"MsoNormalTable" is phrase which I'd like search for
Krx
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#56287
Re:How to use LIKE in mySql? 8 Years, 5 Months ago Karma: 747
This query is an incorrect. For example if you want to search 'Sample phrase' string, the query will look like:

Code:


SELECT 
  id,
  b_ref_id,
  add_date,
  last_modified_time_stamp
FROM 
  vit2_rpl_properties
WHERE
  description_hr_hr LIKE '%Sample phrase%'



Regards,
ARI Soft
The administrator has disabled public write access.
 
#56288
Re:How to use LIKE in mySql? 8 Years, 5 Months ago Karma: 1
Hi

This worked.
Thanks a lot

Best regards
Krx
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1