Jump to content

Building search for MySQL and need help with Query


$username

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.