Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 386483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:34:51+00:00 2026-05-12T15:34:51+00:00

I want to sort data from mysql. The shema looks like this: id int(11)

  • 0

I want to sort data from mysql.

The shema looks like this:

  id    int(11)             
  objectId  int(11)             
  type          tinyint(4)          
  field     tinyint(4)          
  value     int(11)             
  date          int(10)

id  objectId    type    field   value   date
1   1631    0   10  2918    1183  746534
2   1631    0   11      1108    1183  746534

Now My problem is I can’t order by objectId and date
Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:34:52+00:00Added an answer on May 12, 2026 at 3:34 pm

    If you want to order by object id first then date:

    SELECT * FROM table_name ORDER BY objectId, date
    

    If you want to order by date then object id:

    SELECT * FROM table_name ORDER BY date, objectId
    

    To get the results in PHP in the same order:

    $res = mysql_query ("SELECT * FROM table_name ORDER BY date, objectId");
    
    while ($row = mysql_fetch_object($res))
    {
        echo "Object id: $row->objectId Date: $row->date\n";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to sort data from on this page: http://www.excelwrestling.com/sortbymostwinsbyweight.php I want the
I want to sort the data from a mysql database when clinking in the
I want to load some data from mysql into my cocoa application view before
I want to get data from the database (MySQL) by JPA, I want it
I have data that I want to pull from a mySQL database and I
If i have data in my MySQL like this table: data(TEXT) foo (hal) foo
I can't seem to perform the proper selections from mySQL data. $sort = $_GET['sort'];
Imagine that you have 2 tables like this: mysql> SELECT * FROM theme; +----+---------+------------+
i am trying to sort mysql data with alphabeticaly like A | B |
I want to sort a NSMutableArray which has NSArrays with respect to the value

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.