Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. MySQL join unable to select from one table
  2. SELECT score.recipient, score.amount, u.* FROM score
  3. LEFT JOIN `users` AS u ON score.recipient = u.id AND u.team_id = ?
  4. WHERE UNIX_TIMESTAMP(score.date) > ?
  5.        
  6. [0] => stdClass Object ( [recipient] => 1 [amount] => 1 [id] => [fname] => [lname] => [nickname] => [email] => [phone] => [reg_key] => )
  7. [1] => stdClass Object ( [recipient] => 103 [amount] => -1 [id] => [fname] => [lname] => [nickname] => [email] => [phone] => [reg_key] => )
  8.        
  9. SELECT score.recipient, score.amount, u.* FROM score
  10. LEFT JOIN `users` AS u ON score.recipient = u.id