| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
- Pages:
- 1
- 2
| Tricky PHP/SQL problem | |
|---|---|
| Tweet Topic Started: May 5 2005, 07:03 PM (800 Views) | |
| Seth | May 7 2005, 09:46 PM Post #16 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I'm selecting a username from the accounts table, then finding how many times it appears. I defined the COUNT() AS dracula so it could be accessed in PHP later. I want to look at EVERY piece of data in the accounts table, so I SELECT FROM it. I JOIN on the table that will not necessarily be used 100%. |
![]() |
|
| Seth | May 7 2005, 09:51 PM Post #17 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Also LEFT JOIN ensures that even if a user has won no games, they will still show up in the resultset with a count of 0. |
![]() |
|
| JCink | May 7 2005, 10:11 PM Post #18 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Okay thanks for explaining that. I think I understand it... thanks for everything. its been a great help. *JCink can stop pounding head against wall trying to figure that out now. XD |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
- Pages:
- 1
- 2
| Track Topic · E-mail Topic |
8:35 AM Jul 11
|



![]](../../../../0/1/0/p601690/pipright.png)



8:35 AM Jul 11