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.. Quote 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. Quote 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.. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.