× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

DIsplaying a subset of the current main data table

More
11 years 3 months ago - 11 years 2 months ago #1570 by GuiGuy
I've been fooling around with sub templates but not having much luck. SO, some questions;


Can I use a mysql VIEW as the data source for a sub template? If so, what are the pre-requisites?

If I cannot use a VIEW, can I use the same table as the main table to show the records that match the detail criteria?

Does the sub table detail key field have to be indexed?

Thanks
Last edit: 11 years 2 months ago by joest.

Please Log in to join the conversation.

More
11 years 2 months ago #1577 by Dirk

GuiGuy wrote: I've been fooling around with sub templates but not having much luck. SO, some questions;


Pro-Version?
joodb.feenders.de/forum/2-tutorials-and-...how-to-get-help.html

Please provide us with the structure and your configuration.
Where is the problem? There was an Issue with a to short value field in the joodb_settings table. Change the value field to TEXT type.
ALTER TABLE  `jos_joodb_settings` CHANGE  `value`  `value` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

GuiGuy wrote: Can I use a mysql VIEW as the data source for a sub template? If so, what are the pre-requisites?

I guess you can. But it is not neccesary.

GuiGuy wrote: Does the sub table detail key field have to be indexed?

NO

Please Log in to join the conversation.

More
11 years 2 months ago - 11 years 2 months ago #1608 by GuiGuy
Thanks for the reply and sorry about not getting back here sooner;

Using PRO version

Looking at my problem again, what is the restriction on the master record field by which the sub-set or detail records are selected? By example:

mytable
fieldID = Primary Key field
CustomerID = LONG // CustomerID
AreaID = LONG // customer's locale


User selects a record from mytable. Now I want to show a sub set of records from mytable selected by the AreaID field value from the record the user selected.

Should that be possible?


Thanks
Last edit: 11 years 2 months ago by GuiGuy.

Please Log in to join the conversation.

More
11 years 2 months ago #1611 by Dirk

GuiGuy wrote: Should that be possible?


It is possible. But I am still not sure that I completely understand your plan.

You want to sell single entries from a database?

As long as I understand:
You need/have 3 tables
1: Your customer-table (That's your main joodb table customer data)
2: Joomla user-table (Linked 1:1 from user.id to customer.userid of the main-table)
3: Your data-table (linked 1:n from customer.area to data.area)

You should also set customer.userid of your main table as Joomla USER-ID field.

But I maybe you want something more sophisticated like individual data for every user or so.

Please Log in to join the conversation.

More
11 years 2 months ago #1621 by GuiGuy
Hi Dirk,
The scenario is quite simple;

There are n records. Each record belongs to a group or category.

When the user select a single record, I want them to be able to click a button to see a list of all of the other records that belong to the same set as one selected.

So, in pseudo SQL,
"SELECT * FROM mytable WHERE mycategory = " + [the value of the category to which the selected record belongs].

Irrespective, I have no luck displaying data in sub-templates at all, even when using a very simple master-> detail table setup, for example, tbl_orders -> tbl_ordertransactions.

Please Log in to join the conversation.

More
11 years 2 months ago - 11 years 2 months ago #1623 by Dirk
Sorry I cant help you because I don't know if your setup is valid or not

Pleas look here
1073-how-to-get-help.html

I need your complete SQL structure and setup.
Email it to our office.

Why do you want to use a subtable at all?
Look at the example database.

Even if you use a subtable all you need do is a 1:N relation using the AreaID.
Last edit: 11 years 2 months ago by Dirk.

Please Log in to join the conversation.

Moderators: Dirkjoest