ainoy31 Posted June 11, 2007 Share Posted June 11, 2007 I have a search option on my webpage where users enter someone's first and last name and click in the search button. If the record is found in the database, the record data will be displayed else return an error message. Instead of typing the full first and last name such as Olivia True, I want to just enter the first three letters for the first and last name. Should I use a wildcard character or what is the best way to handle this? Much appreciation. thx. AM Link to comment https://forums.phpfreaks.com/topic/55141-search-feature/ Share on other sites More sharing options...
B34ST Posted June 11, 2007 Share Posted June 11, 2007 try the like function using % as a wildcard, alternatively to the % if u know how many extra letters there is than 3 u could use undscore (each underscore represents another letter so if i search for oli___ it would show olivia: $sql = mysql_query("SELECT * FROM table_name WHERE columnname LIKE value%"); Link to comment https://forums.phpfreaks.com/topic/55141-search-feature/#findComment-272611 Share on other sites More sharing options...
ainoy31 Posted June 11, 2007 Author Share Posted June 11, 2007 thanks dude. Link to comment https://forums.phpfreaks.com/topic/55141-search-feature/#findComment-272637 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.