Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 18/11/2017 Black Friday is coming

    Don't wait BLACK FRIDAY, use FRIDAY17 coupon code to get 35% discount for all our extensions right now.

  • 05/09/2017 BIG Autumn SALE

    Use AUTUMN17 coupon code to buy our WordPress or Joomla! extensions with 25% discount. Hurry up! The offer is valid till 11 September.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Left join returns blank page
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Left join returns blank page
#40837
Left join returns blank page 4 Years, 7 Months ago Karma: 0
This works fine:
{arisqltable}
{arisqltablecolumns}
{arisqltablecolumn id="name"}
{arisqltablecolumn id="email"}
{/arisqltablecolumns}
{arisqltablequery}
SELECT name, email FROM j25_users
{/arisqltablequery}
{/arisqltable}

And this works in phpMyAdmin:
SELECT name, email
FROM j25_users
LEFT JOIN j25_user_usergroup_map
ON j25_user_usergroup_map.user_id = id
WHERE name like '%John%'

But I cannot get this LEFT-JOIN to work:
{arisqltable}
{arisqltablecolumns}
{arisqltablecolumn id="name"}
{arisqltablecolumn id="email"}
{/arisqltablecolumns}
{arisqltablequery}
SELECT name, email
FROM j25_users
LEFT JOIN j25_user_usergroup_map
ON j25_user_usergroup_map.user_id = id
WHERE name like '%John%'
{/arisqltablequery}
{/arisqltable}

Any suggestions? TIA
John
The administrator has disabled public write access.
 
#40844
Re:Left join returns blank page 4 Years, 7 Months ago Karma: 670
Hello,

Try the following SQL query:

Code:


SELECT 
  name, 
  email
FROM 
  #__users U LEFT JOIN #__user_usergroup_map M
    ON M.user_id = U.id
WHERE 
  U.name LIKE '%John%'



Regards,
ARI Soft
The administrator has disabled public write access.
 
#40870
Re:Left join returns blank page 4 Years, 7 Months ago Karma: 0
Thanks for the prompt reply, but no luck with that one.
The administrator has disabled public write access.
 
#40876
Re:Left join returns blank page 4 Years, 7 Months ago Karma: 670
Could you provide a link to a page where we can see the problem and a temporary access to your J! backend by email so we can investigate the problem?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#40881
Re:Left join returns blank page 4 Years, 7 Months ago Karma: 0
Thank you for your excellent support.

Here is the code you provided me that worked:

Code:


{arisqltable saveTags="false"}

{arisqltablequery}SELECT U.name, U.email FROM #__users U LEFT JOIN #__user_usergroup_map M ON M.user_id = U.id WHERE U.name LIKE '%John%'{/arisqltablequery}

{/arisqltable}

The administrator has disabled public write access.
 
Go to topPage: 1