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


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


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 10 Years, 12 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 10 Years, 11 Months ago Karma: 748
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 10 Years, 11 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 10 Years, 11 Months ago Karma: 748
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 10 Years, 11 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