• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

List from Joomla 3 / Virtuemart 3 tables

heypachuco

New Member
I just started working with Fabrik and have run into a problem I cannot figure out.

To start, I'm trying to show a list displaying a few fields from two different mySQL tables. I've created a list for each table, but cannot figure out how to join the two to show the desired fields in one list.

Any help would be greatly appreciated.
Thank you.
 
Is there a "foreign key" on one of the tables? A column that holds a key pointing at the primary key of the row it is related to in the other table?

-- hugh
 
No.
I now remember reading about foreign keys in one of the tutorials the other day, but did not understand how to implement one.
 
OK. Foreign keys aren't a "Fabrik thing" they are just a database thing. Obviously if you want to show rows from one table in another, you need to know how the rows relate to each other. So if you are displaying a "parent" table and what to include the "children", the rows in your child table need to have a column that points to the parent they belong to. So you'd have a child.parent_id FK (foreign key) pointing to the parent.id (Primary Key).

Then there's the issue of whether this is a simple one-to-one relationship, so each row in the two tables is only related to one row in the other (husband <-> wife), or one-to-many (mother <-> children).

So do you need one-to-one or one-to-many?

-- hugh
 
Thank you for the explanation, and I'm sorry for the delay in my reply.

Both tables include ?virtuemart_product_id? column, so I had thought this could be used to match the data in my attempts to do this myself. Will this be adequate?

I?d like this to be a one-to-one relationship.


Thank you.
 
Hmm, that'll only work if one of the tables is the VM product table, where the 'virtumart_product_id' is the primary key. Our list join code assumes a "Foreign Key points to Primary Key" relationship, so even on one-to-one (non repeat) list joins, one "end" of the join has to be the PK of the table it is on. You can't join FK <-> FK.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top