Results 1 to 7 of 7
  1. #1

    mysql non-existant select

    i have a field called important, and it should list any rows that contain the important tag first so i have it setup to select important, but then i want it to list any topics that dont have important, how can i do this?


    none of those work, so i dont what to do next.

    how do you do this, i cannot seem to find it through google either.
    workstations&servers @

  2. #2
    this is in the mysql_query(); too if that wanst implied
    workstations&servers @

  3. #3
    Join Date
    Mar 2005
    Just give 2-3 lines of your php code containing the specific part so that we'll understand your question better.
    Whats wrong in an innocent cup of tea ?

  4. #4
    Join Date
    Jan 2003
    You can ORDER BY any value, including, if so inclined, constants and boolean equations. You probably want something like

    ORDER BY important = 1, itemID LIMIT x

    Note that this requires pulling the full select result to sort it, so make sure your WHERE clauses reduce the result set to something sane.
    Game Servers are the next hot market!
    Slim margins, heavy support, fickle customers, and moronic suppliers!
    Start your own today!

  5. #5
    well i am already ordering by time, can i order by both? important first, then time?
    workstations&servers @

  6. #6
    Join Date
    May 2004
    ORDER BY col1 DESC, col2;
    would order by col1 in descending order, then order by col2.
    char*s="#include<cstdio>%cchar*s=%c%s%c;%cint main(){std::printf(s,10,34,s,34,10);}";
    int main(){std::printf(s,10,34,s,34,10);}

  7. #7
    thanks, got it working with that
    workstations&servers @

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts