Jump to content

query problem in fetching records using oracle and php

Recommended Posts

i have table called location_state , the fields are stateid and statename.

for example : i have inserted the statename as karnataka.


in my search module, if i try to search this record with "KARNATAKA " . it is not displaying the above record. i hav used query as

select * from location_state where state_name like '%KARNATAKA%';


THE Query is working fine if i write like ---select * from location_state where state_name like '%karnataka%';


how would i search if an user is typing in uppercase letter while searching. pls help guys....

Link to post
Share on other sites

you need to format the search value before you run the actual search query. so when the value entered is passed to the php code,

// if $location = KARNATAKA
$location = strtolower($location);
// would change it to 'karnataka'

Link to post
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.