Mutley Posted September 3, 2006 Share Posted September 3, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/19586-only-show-rows-that-dont-have-xyz-urgent/ Share on other sites More sharing options...
Mutley Posted September 3, 2006 Author Share Posted September 3, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/19586-only-show-rows-that-dont-have-xyz-urgent/#findComment-85215 Share on other sites More sharing options...
shocker-z Posted September 3, 2006 Share Posted September 3, 2006 SELECT * FROM table WHERE XYZ = '' ORDER by date ASCThink that should do the job :) Quote Link to comment https://forums.phpfreaks.com/topic/19586-only-show-rows-that-dont-have-xyz-urgent/#findComment-85217 Share on other sites More sharing options...
Mutley Posted September 3, 2006 Author Share Posted September 3, 2006 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, awayWherescorehome is EMPTYIs what I want to do. Quote Link to comment https://forums.phpfreaks.com/topic/19586-only-show-rows-that-dont-have-xyz-urgent/#findComment-85221 Share on other sites More sharing options...
Mutley Posted September 3, 2006 Author Share Posted September 3, 2006 Fixed the bugger, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/19586-only-show-rows-that-dont-have-xyz-urgent/#findComment-85222 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.