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:

Username:   Password:
Add Reply
  • Pages:
  • 1
  • 2
Tricky PHP/SQL problem
Topic Started: May 5 2005, 07:03 PM (800 Views)
Seth
Member Avatar
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%.
Offline Profile Quote Post Goto Top
 
Seth
Member Avatar
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.
Offline Profile Quote Post Goto Top
 
JCink
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
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply
  • Pages:
  • 1
  • 2