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


Recent Events
  • 23/11/2024 Black Friday 2024

    BIG SALE, 30% discount for all our extensions. Use BF24 coupon code. Hurry up the discount is valid till 3 December.

  • 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.


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 11 Years, 6 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 11 Years, 6 Months ago Karma: 760
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 11 Years, 6 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 11 Years, 6 Months ago Karma: 760
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 11 Years, 6 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