Search
Other Articles Anywhere questions
Forum

Getting data from External Database

Alan N's Avatar Alan N
Hi,

I have a separate products database (on the same server) that has tables for specific manufacturers.

I have set up a database connection in Articles Anywhere.

What I'm wanting to do is populate an article with data from the table columns such as PartNumber, ShortDesc, Long Desc, AccType etc.

I've tried using:
{articles database="Radio Accessories" table="boxes"}

{if id="938"}
<p>data="PartNumber"</p>
{/if}

{/articles}

I'm a little lost as I get no output at all and am wondering if I'm connecting to the database. I have not added a database tables prefix in the connection details as that appears not to be required.

Can anyone advise on how to test the database connection and if the syntax should work?

Thank you in advance.
Peter van Westen's Avatar Peter van Westen ADMIN
That is not what the external database functionality in Articles Anywhere is for.
Articles Anywhere - as the name suggests - outputs article related data.

It can't just grab data from any table you want. There is also no 'table' attribute available in Articles Anywhere.

If you want to show data from whatever table, you will need to write some (basic) PHP code.
You could use Sourcerer to place that code in your article/content.
See: docs4.regularlabs.com/sourcerer/the-basi...ting-to-the-database
Please post a rating at the Joomla! Extensions Directory
Alan N's Avatar Alan N
Hi Peter, thank you for the clarification - I have TOTALLY mis-interpreted that functionality - I'm sorry to waste your time.

After submitting this and going through more of your documentation I was coming to the conclusion I had the wrong tool for that job.

Thank you for you suggestions - that was what I was originally going to look at doing but I thought I had found something to make that part easier from a site user point of view.

As I have to create all the articles anyway, I'll use custom fields and keep all the data inside of Joomla so I can use the Articles Anywhere features.

Thanks again,

Best regards
Peter van Westen's Avatar Peter van Westen ADMIN
Ok 🙂👍
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription