Jump to content


Photo

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


  • Please log in to reply
4 replies to this topic

#1 Mutley

Mutley
  • Members
  • PipPipPip
  • Advanced Member
  • 765 posts

Posted 03 September 2006 - 04:26 PM

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.
~ Mutley.

#2 Mutley

Mutley
  • Members
  • PipPipPip
  • Advanced Member
  • 765 posts

Posted 03 September 2006 - 04:34 PM

Something like this?

$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";

~ Mutley.

#3 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 03 September 2006 - 04:37 PM

SELECT * FROM table WHERE XYZ = '' ORDER by date ASC


Think that should do the job :)
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#4 Mutley

Mutley
  • Members
  • PipPipPip
  • Advanced Member
  • 765 posts

Posted 03 September 2006 - 04:41 PM

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.

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

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

Where
scorehome is EMPTY

Is what I want to do.
~ Mutley.

#5 Mutley

Mutley
  • Members
  • PipPipPip
  • Advanced Member
  • 765 posts

Posted 03 September 2006 - 04:43 PM

Fixed the bugger, thanks.
~ Mutley.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users