$username Posted January 3, 2008 Share Posted January 3, 2008 Hello Everyone, I am trying to build a query to search my tables. What I am getting is it will find all of the info from all fields and then when I out put it in PHP it will show up as many times as it found it in the same table field. So here is example First Name | LastName | email| Timmy | Billy | timmy@gmail.com __________________ So when I search it shows the same search 2 times I need to know if there is a way to restrict the search so it does not show 1 column 2 times when it searches? Or is this something I have to do in PHP? $query213 = "SELECT * FROM `tdb_` . `contacts`, `tdb_` . `account` WHERE ( contacts.ContactFname LIKE CONVERT( _utf8 '%$trimmed%' USING latin1 ) COLLATE latin1_swedish_ci OR contacts.ContactLname LIKE CONVERT( _utf8 '%$trimmed%' USING latin1 ) COLLATE latin1_swedish_ci OR contacts.ContactPhone LIKE)" Thanks for any help Brett Quote Link to comment https://forums.phpfreaks.com/topic/84228-building-search-for-mysql-and-need-help-with-query/ Share on other sites More sharing options...
fenway Posted January 3, 2008 Share Posted January 3, 2008 That's because you have no join condition between those 2 tables ... has nothing to do with the "searching" perse. Quote Link to comment https://forums.phpfreaks.com/topic/84228-building-search-for-mysql-and-need-help-with-query/#findComment-429277 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.