Jump to content

Archived

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

Mutley

Only show rows that don't have XYZ (urgent)

Recommended Posts

I want to display all my database rows in date order that don't have any data in the XYZ field. How do I do this? So it bypasses fields that have data in field XYZ?

Thanks.

Share this post


Link to post
Share on other sites
Something like this?

[code]$query = "SELECT team_id, DATE_FORMAT(date,'%d-%m-%Y') AS dstamp, home, away FROM scores [b]WHERE scorehome=''[/b] ORDER BY date LIMIT 1";
[/code]

Share this post


Link to post
Share on other sites
SELECT * FROM table WHERE XYZ = '' ORDER by date ASC


Think that should do the job :)

Share this post


Link to post
Share on other sites
Nope, it still finds the entry with the data in and shows it first, I don't want it to show the one with the data in the specific field.

[code]$query = "SELECT team_id, DATE_FORMAT(date,'%d-%m-%Y') AS dstamp, home, away FROM scores WHERE scorehome = '' ORDER BY date LIMIT 1";[/code]

So show:
team_id, DATE_FORMAT(date,'%d-%m-%Y') AS dstamp, home, away

Where
scorehome is EMPTY

Is what I want to do.

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.