Using Left Join In Joomla (MySQL)
Wanted to show you how easy it is to use the Left Join function in MySQL inside of Joomla.
First you need to figure out which 2 tables you need to connect.
We want to get the access and username of each entry in the
Second you want to prepare the query with the LEFT JOIN for the 2 tables that you’d like to connect.
Third we want to set the query.
Finally we send the query, return the result and print it to the page.
The result will be in an object oriented list like this:
This was an example of returning a single row back, if your query calls for multiple rows to be returned, you are going to want to change the
loadObjectList(). What this does is places all of the results in a numbered array but still keeps the object oriented format, which is what I prefer, but to each there own. So let me know what you think, and hope this helped!