gazfocus Posted May 5, 2008 Share Posted May 5, 2008 I am trying to create a search page which will pull its results out of a MySQL database and I have got this working fine, but is there a way I can search for say title CONTAINS rather than title EQUALS so I can search for one word in an entire description? Thanks Link to comment https://forums.phpfreaks.com/topic/104290-solved-mysql-search-query/ Share on other sites More sharing options...
IsmAvatar Posted May 6, 2008 Share Posted May 6, 2008 SELECT * FROM table WHERE name LIKE "%val"; where % is a wildcard. "%val" searches for strings ending with "val" "val%" strings starting with "val" "%val%" strings containing "val" anywhere. Link to comment https://forums.phpfreaks.com/topic/104290-solved-mysql-search-query/#findComment-533993 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.