Jump to content

Bricktop

Members
  • Posts

    677
  • Joined

  • Last visited

    Never

Everything posted by Bricktop

  1. Perfect! Thanks premiso - the UNION option worked a treat!
  2. Hi all, I have the following query, as simple as it gets: $sql = mysql_query("SELECT * FROM news ORDER BY category, id DESC"); This will output: WORLD NEWS story 1 story 2 story 3 story 4 LOCAL NEWS story 1 story 2 story 3 story 4 story 5 TECH NEWS story 1 story 2 story 3 What I want is to limit the output of EACH category by 3 so I get: WORLD NEWS story 1 story 2 story 3 LOCAL NEWS story 1 story 2 story 3 TECH NEWS story 1 story 2 story 3 Obviously: $sql = mysql_query("SELECT * FROM news ORDER BY category, id DESC LIMIT 3"); Just gives: WORLD NEWS story 1 story 2 story 3 Hope this makes sense, any ideas how I can achieve this? Thanks
×
×
  • 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.