Jump to content

boonamera

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Posts posted by boonamera

  1. table 1 (users)
    userid
    username

    table 2(payments)
    paymentid
    userid

    I need two things
    USERIDS of those who PAID. This works:
    SELECT u.userid FROM users u JOIN payments ON u.userid = payments.userid;

    USERIDS of those who haven't paid. This is my problem
    I tried something along the lines of: but no luck
    SELECT u.userid FROM users u LEFT JOIN payments ON u.userid = payments.userid LIMIT 99999 OFFSET ("SELECT ( (SELECT COUNT(*) FROM users)-(SELECT COUNT(*) FROM payments) ));
    but no luck

    anyone have an idea?

  2. What would be the best way to structure a database so that users can add friends.

    Right now i have a simple user table which includes
    userid
    username
    password
    emai

    thanks

    edit:
    ok more info:
    let's say the following user
    1
    boonamera

    wants to add as a friend
    2
    booya

    how would you record this relationship?
    I'm asking what field would you put in the friends table if that's how you suggest doing it.

×
×
  • 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.