imagine i have this table named "test_table" in the "test_db" in MySQL :
field1 field2
google http://google.com
apple http://apple.com
python http://python.org
now if i search db using this :
SELECT * FROM test_table WHERE field1 = "google";
it returned : http://google.com
now i want to search database with field1 and return field2 value where field1 like to search keyword .
for example if i give it "googles" it returned : http://google.com
how i can do this ?
thanks a lot .
SELECT field2 FROM test_table WHERE 'googles' LIKE CONCAT( '%', field1, '%' );– ypercube Jan 22 at 22:46