sql join x3 in 'Select' statement

Hello. I’m unfortunately stuck with adding a 3rd SQL join in my select statement. The working version is as follows:
[php]$query = “SELECT * FROM dlao2_users as u left outer join dlao2_kunena_users as k on u.id=k.userid where u.username like '%”.$_GET[‘username’]."%’";[/php]

I obviously know the next one is wrong (This is why I’m asking here) but how can I change this to get it all working together? Any ideas?
[php]$query = “SELECT * FROM dlao2_users as u left outer join dlao2_kunena_users as k left outer join dlao2_alpha_userpoints as p on u.id=k.userid and u.id=p.userid where u.username like '%”.$_GET[‘username’]."%’";[/php]

The result I get from the last one is simply a blank screen, no fatal errors or whatnot.

Thanks.

Not sure what you are asking…

Can you explain the parts of your query? What are you attempting to join?
Your statement:

SELECT * FROM dlao2_users as u
left outer join dlao2_kunena_users as k
left outer join dlao2_alpha_userpoints as p on u.id=k.userid and u.id=p.userid
where u.username like ‘%".$_GET[‘username’]."%’

But, I am not sure what is inside the data. You can process the query in sections and see where it is failing. A nice site for learning is W3 Schools. Here is a link to the site where they explain joins. Maybe this will help you find your error: http://www.w3schools.com/sql/sql_join_left.asp

Sponsor our Newsletter | Privacy Policy | Terms of Service