Computer Forum  

Go Back   Computer Forum > Computer Forums > Programming Forum > Mysql Forum

Mysql Forum Mysql Forum


PHP/MySQL case question?

Mysql Forum

Mysql Forum


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-12-2008, 07:58 AM
Junior Member
 
Join Date: Sep 2008
Posts: 15
Timbuktu RSS Feed
PHP/MySQL case question?

in my search engine script, i have the "select * from table1 where column1 like %$_POST[search]% or column2 like etc". But when i conduct the search, things appear to be case sensitive. For example, when searching for date, e.g. June, if i typed june, i couldn't find anything, only if i typed June.

i could use the "strtoupper" function like:

$_POST[search]=strtoupper($_POST[search]); before the query above, and then search all in CAPS?

any other solutions which will make things case insensitive?
or put differently: how do you make a query result case insensitive?
Reply With Quote
  #2 (permalink)  
Old 09-12-2008, 09:03 AM
Junior Member
 
Join Date: Sep 2008
Posts: 2
Palash RSS Feed
just try this code

"select * from table1 where column1 like '%$_POST[search]%'"

bsc your query is string not integer thats why your query not working properly.
Thanks
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL question< can you help? Timbuktu Mysql Forum 1 09-09-2008 06:17 AM
MySql decode or select case? Lukene Mysql Forum 0 09-06-2008 12:54 AM
PHP, Mysql question. How can I list the most recent entries in a mysql database -- JuliuS -- d Mysql Forum 0 09-05-2008 11:56 PM
question about mysql? feqaf w Mysql Forum 0 08-24-2008 04:52 PM
MySQL question...? Justin H Mysql Forum 0 08-24-2008 04:22 PM


All times are GMT. The time now is 04:48 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93