Any mysql wizards here? |
[eluser]Sarre[/eluser]
I was playing around with the CXForum code (http://ellislab.com/forums/viewthread/91409/), and got stuck on a query. So here's a little mysql challenge (well, it's a challenge for me at least ) Suppose I want to collect data from three tables (only showing relevant columns): Code: Table USERS Code: --------+--------+---------+-------+--------------+------------------ I got this far: Code: SELECT t.*, u.username as user FROM forum_topics t JOIN users u ON t.user_id = u.id Thanks!
[eluser]davidbehler[/eluser]
Code: SELECT It's untested, but I guess that might work.
[eluser]Sarre[/eluser]
Thanks for the quick response! Unfortunately, I'm getting an error: Quote:Error Number: 1054 I'm looking into it...
[eluser]Sarre[/eluser]
Did I mention you are brilliant? Thanks!!! :-) P.S. In case someone else uses this, I also had to change u2.user_id to u2.id etc... |
Welcome Guest, Not a member yet? Register Sign In |