
Untitled
By: a guest on
May 2nd, 2012 | syntax:
None | size: 0.58 KB | hits: 12 | expires: Never
MySQL join unable to select from one table
SELECT score.recipient, score.amount, u.* FROM score
LEFT JOIN `users` AS u ON score.recipient = u.id AND u.team_id = ?
WHERE UNIX_TIMESTAMP(score.date) > ?
[0] => stdClass Object ( [recipient] => 1 [amount] => 1 [id] => [fname] => [lname] => [nickname] => [email] => [phone] => [reg_key] => )
[1] => stdClass Object ( [recipient] => 103 [amount] => -1 [id] => [fname] => [lname] => [nickname] => [email] => [phone] => [reg_key] => )
SELECT score.recipient, score.amount, u.* FROM score
LEFT JOIN `users` AS u ON score.recipient = u.id