Display infomation from multiple tables

7 posts by 2 authors in: Forums > CMS Builder
Last Post: September 29, 2010   (RSS)

By gadefgaertgqe - September 28, 2010 - edited: September 28, 2010

Hello,

From what I have read I think the answer is no but there is nothing like a direct answer to a question ;)

I have multiple tables.

Each table contains specific contact details for each 'member'

In each table is a postcode field.

Is is possible to pull the content from the postcode field in all tables so I can then do stuff with it.

I have just over 100 'members' meaning there are 100+ tables.

Many thanks in advance!

Paul

Re: [Jason] Display infomation from multiple tables

Hi Jason,

Thanks for getting back to me :)

Each member (now know as a dealer after changes made to the database today) is stored in a seperate table. For example:

Section (Table): dealer_1_contact
Fields: Address, Postcode, name, etc

Section (Table): dealer_2_contact
Fields: Address, Postcode, name, etc

It is a modified version of the contact template which is a Section Type: Single Record.

All sections (tables) are identical in structure.

Fingers crossed that makes sense :)

Paul

Re: [8bit Gamer] Display infomation from multiple tables

By Jason - September 28, 2010

Hi Paul,

I see what your saying. Although it is possible to get the postcode from each of the tables, it would be quite a lot of work since you would have to include the name of each table you want to search in your MySql query.

The best thing to do would be to create 1 multi-record section (ex dealer_contact) and have each dealer as having 1 record in that section. This way you would only have to search 1 table to get everything you need. This would also mean you wouldn't have to recreate your same structure every time you added a new dealer.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Display infomation from multiple tables

Hello Jason,

Yeah normally I would do it that way but I have done it different this time as I have it setup so that depending on what subdomain they are it, it loads the relevant data. This is normally fine but for a dealer locator function I have setup in google maps, I now find myself needing them all togther in one table lol!

Would the solution you mention needa list of every table, be manualy updated for the search?

Also would it place much load on the SQL server?

Thanks

Paul

Re: [8bit Gamer] Display infomation from multiple tables

Hi Jason,

Ignore this thread now :)

I have now learnt how to merge arrays (for another part of the site) and understand what is required for the postcode search.

I am looking at alternatives :)

Thanks for your help!

Paul

Re: [8bit Gamer] Display infomation from multiple tables

By Jason - September 29, 2010

Hi Paul,

No problem. Let me know if you run into any issues.

thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/