MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old June 30th, 2000, 11:56 AM
tlkhjb tlkhjb is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 5 tlkhjb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SORRY, I'm german, my english isn't good to reed!

My problem is the follows:

I'm looking for a statement searching anything from a database. I use this one and i will get only exact answers!
$sql = "SELECT column FROM table WHERE(table.column LIKE '%$word%')";

In table there is f.i. "Hallo" and if I have a look about "hallo" I will get an Emty! If I have a look about "Hallo" I will get "Hallo"!

Can you help me, finding a statement wich will give back "Hallo" if I have ask "hallo"?

SORRY again my english! I hope you can understand what I'm looking for.

bye,
Hannes

Reply With Quote
  #2  
Old June 30th, 2000, 01:22 PM
lhallusa lhallusa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 43 lhallusa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via ICQ to lhallusa
Try this.
$sql = "SELECT column FROM table WHERE lcase(table.column) REGEXP lcase($word)";
Using REGEXP is far superior to LIKE because you can do things such as REGEXP lcase($word1|$word2). This will return all with word1 or word2 in it.
Also the lcase(table.column) will turn everything into lowercase just for the query and make it a case insensitive query.


Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > search using LIKE


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway