G
greg
Guest
thanks to debbie for the dadabik_sample code - it very clearly shows the construction & use of a table with the foreign key feature.
i am interested in getting the "show all" view to display all linked info based on the foreign key field in a *single* cell within the entire record as opposed to printing the entire record repeatedly with each row having the next "linked info record".
maybe it would be simpler to illustrate with an example. i have two tables:
CREATE TABLE 'main' (
'id' mediumint(8) NOT NULL auto_increment,
'title' varchar(64) NOT NULL default '',
'hist_id' mediumint(8) NOT NULL,
PRIMARY KEY ('id') );
CREATE TABLE 'history' (
'id' mediumint(8) NOT NULL auto_increment,
'main_id' mediumint(8) NOT NULL,
'event_date' date NOT NULL default '0000-00-00',
'event_description' varchar(255) NOT NULL,
PRIMARY KEY ('id') );
The 'history' table contains any number of distinct records containing a running history for each item in the 'main' table.
so to get back to my question, in the "show all" view i wanted to see a single row for each record in 'main' and all the "linked info" from the 'history' table within that same row. for example:
main.title history.date history.description
"Piece 1" "2004-07-01" "history event #1"
"2004-07-02" "history event #2"
"2004-07-03" "history event #3"
i can not see any way within dadabik to configure this, so, unless i am missing something, would it be a complicated endeavor to change the code in business_logic to do this?
tia, greg
i am interested in getting the "show all" view to display all linked info based on the foreign key field in a *single* cell within the entire record as opposed to printing the entire record repeatedly with each row having the next "linked info record".
maybe it would be simpler to illustrate with an example. i have two tables:
CREATE TABLE 'main' (
'id' mediumint(8) NOT NULL auto_increment,
'title' varchar(64) NOT NULL default '',
'hist_id' mediumint(8) NOT NULL,
PRIMARY KEY ('id') );
CREATE TABLE 'history' (
'id' mediumint(8) NOT NULL auto_increment,
'main_id' mediumint(8) NOT NULL,
'event_date' date NOT NULL default '0000-00-00',
'event_description' varchar(255) NOT NULL,
PRIMARY KEY ('id') );
The 'history' table contains any number of distinct records containing a running history for each item in the 'main' table.
so to get back to my question, in the "show all" view i wanted to see a single row for each record in 'main' and all the "linked info" from the 'history' table within that same row. for example:
main.title history.date history.description
"Piece 1" "2004-07-01" "history event #1"
"2004-07-02" "history event #2"
"2004-07-03" "history event #3"
i can not see any way within dadabik to configure this, so, unless i am missing something, would it be a complicated endeavor to change the code in business_logic to do this?
tia, greg