Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2001
    Location
    California
    Posts
    1,991

    PHP/MySQL ISSUE! Help please

    I have a membership site and users can upgrade to premier.
    When they upgrade to Premier an invoice is created and their Premier status is set to 1. Now, when displaying a list of users I want to ORDER them first according to Premier Status, then based on the date they became Premier. The date they became Premier is in the invoice. So how can I reference this date?
    I know this question is a bit confusing, but if anyone can help I would really appreciate it.
    Thanks!

  2. #2
    a little database info would be nice, but

    SELECT * FROM `users` ORDER BY (`premier` = 1) DESC, `premier_time` DESC

  3. #3
    Join Date
    Nov 2001
    Location
    California
    Posts
    1,991
    Thanks! the user's table is called members and the invoice table is called invoices. The Premier_time field is in the invoices table. How would I go about referencing that?

  4. #4
    Join Date
    Nov 2001
    Location
    California
    Posts
    1,991
    Any suggestions?

  5. #5
    try adding a new field in the members table, name it premier_time and make it the same as premier_time in the invoices table... that would then when they sign up, have it add to both fields.. thats probably the way i would do it..

  6. #6
    Join Date
    Nov 2001
    Location
    California
    Posts
    1,991
    That's what I did, I wanted to avoid doing that, but it's probably a faster way of doing it anyway.

  7. #7
    i was about to recommend make a script to do it for you, since that would be the fastest way... but you probably already figured that

Posting Permissions

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