PHP MySql select from two tables and order

Discussion in 'PHP' started by gilgil2, Jun 20, 2012.

  1. #1
    Hi


    I have two Mysql tables, one with the information in and another with payment information in. I want to echo the results that have paid first and then the rest of the results. If information has no payment associated with it it does not appear in the payment table.


    Does anyone have any suggestions for the best way to do this? I know it would be much easier to combine the two tables but I coildn't get that to work with PayPal IPN so have set it up this way instead.


    Any suggestions/examples would be greatly appreciated.


    Thanks
     
    gilgil2, Jun 20, 2012 IP
  2. YusIda JoHn

    YusIda JoHn Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    can you provide the each fiields of the table? so may be I can help you.. :)
     
    YusIda JoHn, Jun 20, 2012 IP
  3. prabhunimish

    prabhunimish Member

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    46
    #3
    Try using join followed by an order by clause. You can add an extra flag bit column to indicate whether a customer has paid or not.
     
    prabhunimish, Jun 21, 2012 IP