Jump to content

Archived

This topic is now archived and is closed to further replies.

jaymc

Search

Recommended Posts

Right, I'm making a search to query my table and display results

Ive hit a bit of a problem though

Basically, I have a table that my look like the following (in row display form)

[b]1 Jamie Member Hello Yes
2 Jamie Member Hello Yes
3 Kev Member Hello Yes
4 Kev Member Hello Yes[/b]

Now, my query is going to query the table to find all fields that are [b]Yes[/b]. As you can see in that table, each row has a [b]Yes[/b] field

The way I want it displayed, is return the username once if a row has a [b]Yes[/b]

So, the query would return

Jamie
Kev

Thats the problem I have, I can only get it to return:

[b]Jamie
Jamie
Kev
Kev[/b]

So in other words, once it finds [b]Yes[/b] it only echoes the username once regardless of how many rows its in

How?

Share this post


Link to post
Share on other sites
select distinct * from table where yescolumn = 'Yes'

Share this post


Link to post
Share on other sites
Here is my query

[code]$query = "SELECT distinct * FROM `songs` WHERE `$searchby` LIKE '%$searccriteria%'";[/code]

It isnt working, its still returning all occurances

Share this post


Link to post
Share on other sites
Its working now. For some reason it wasnt allowing me to use the WILD CARD

Share this post


Link to post
Share on other sites
Might have been a variable interpolation issue.

Share this post


Link to post
Share on other sites

×

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.