|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > search using LIKE |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|