otual Posted December 3, 2006 Share Posted December 3, 2006 I'm fairly new to PHP and mySQL, and I am creating a database driven website. I am trying to create a search function that quickly searches for a particular string. I have several tables with multiple text fields, what i was hoping to do is return the UserID number as 1 column and certain text fields from various tables concatinated as another column. That way I can group together all the relevant information and use LIKE to search for the string... Other than that I guess I have to perform multiple searches and keep track of all the matches.. Link to comment https://forums.phpfreaks.com/topic/29292-combining-multiple-database-fields-in-1-returned-field/ Share on other sites More sharing options...
fenway Posted December 3, 2006 Share Posted December 3, 2006 There is full-text searching... but that has a rather limited scope. Link to comment https://forums.phpfreaks.com/topic/29292-combining-multiple-database-fields-in-1-returned-field/#findComment-134492 Share on other sites More sharing options...
otual Posted December 4, 2006 Author Share Posted December 4, 2006 I actually solved my own problem about 5 mins after sending this request for help...I used the function concat in my SQL statement to check for the textstring...[color=navy]select UserNo from UserList where concat(Street,' ',Suburb,' ',State) like '%[color=red][i]$inputstring[/i][/color]%'[/color]This produced satisfactory results for the desired search.. Link to comment https://forums.phpfreaks.com/topic/29292-combining-multiple-database-fields-in-1-returned-field/#findComment-134621 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.