Hi,
first of all thank you for this forum and the component !
I don't know if it s a bug or if I am it.... but I followed step by step your FAQ "How can I link two DB Multi Record Loaders?" and I can't get the same result.
This is what I did, adding debugger :
exactly the same configuration :
1st DBMRL : Table:#_users, Model Id: User, Field boxes : name ; Load data : No, Enabled Asso : No, Join Rule 'Article'.'created_by'='User'.'id', Associated Models : Articles
2nd DBMRL : Table:#_content, Model Id: Articles, Field boxes : title; Load data : Yes, Enabled Asso : Yes, Join Rule : empty, Associated Models : User; Data displayer : Yes, columns to display : title: Title, User.name: Author
The result :
Then I've checked the sql query in phpmyadmin which return an sql error syntax.I've changed the join rule syntax to
1st DBMRL : Join Rule: Article.created_by=User.id (instead of 'Articles'.'created_by'='User'.'id' like the tutorial).
the result is :
Nothing displayed but [Articles] is now an array. I try the sql query in phpmyadmin and it works perfectly. I get two columns with the title of the article and the User.name .
I 've changed the 2nd DBMRL Fields box to name,created_by,id without results. I've changed it to empty and then I get diplayed the articles in my Title column. Author stays empty.
This is the difference between Sql query :
Should it be Articles.title for working ?
I tried a lot of things, using custom code to find the problem, but I can't display correctly the User.name column. I succed getting User array in my Articles array and I am sure that the sql query works, so may be the problem is in the data display fields box with User.name:Author but I don't know what to write instead of.
As a last resort, I could use custom code to it๐
Thx for taking few minutes for helping me and translate me ... Sorry, english isn't my mother tongue .
first of all thank you for this forum and the component !
I don't know if it s a bug or if I am it.... but I followed step by step your FAQ "How can I link two DB Multi Record Loaders?" and I can't get the same result.
This is what I did, adding debugger :
exactly the same configuration :
1st DBMRL : Table:#_users, Model Id: User, Field boxes : name ; Load data : No, Enabled Asso : No, Join Rule 'Article'.'created_by'='User'.'id', Associated Models : Articles
2nd DBMRL : Table:#_content, Model Id: Articles, Field boxes : title; Load data : Yes, Enabled Asso : Yes, Join Rule : empty, Associated Models : User; Data displayer : Yes, columns to display : title: Title, User.name: Author
The result :
Data Array:
Array
(
[option] => com_chronoforms
[tmpl] => component
[chronoform] => test
[Itemid] =>
[Articles] =>
)
Validation Errors:
Array
(
)
Title Author
Debug Data
db_multi_record_loader
SELECT `title`, `User`.`name` AS `User.name` FROM `#_content` AS `Articles` INNER JOIN `#_users` AS `User` ON 'Articles'.'created_by'='User'.'id'
Then I've checked the sql query in phpmyadmin which return an sql error syntax.I've changed the join rule syntax to
1st DBMRL : Join Rule: Article.created_by=User.id (instead of 'Articles'.'created_by'='User'.'id' like the tutorial).
the result is :
Data Array:
Array
(
[option] => com_chronoforms
[tmpl] => component
[chronoform] => test
[Itemid] =>
[Articles] => Array
(
)
)
Validation Errors:
Array
(
)
Title Author
Debug Data
db_multi_record_loader
SELECT `title`, `User`.`name` AS `User.name` FROM `#_content` AS `Articles` INNER JOIN `#_users` AS `User` ON Articles.created_by=User.id
Nothing displayed but [Articles] is now an array. I try the sql query in phpmyadmin and it works perfectly. I get two columns with the title of the article and the User.name .
I 've changed the 2nd DBMRL Fields box to name,created_by,id without results. I've changed it to empty and then I get diplayed the articles in my Title column. Author stays empty.
This is the difference between Sql query :
SELECT `title`, `created_by`, `id`, `User`.`name` AS `User.name` FROM `#_content` AS `Articles` INNER JOIN `#_users` AS `User` ON Articles.created_by=User.id
SELECT `Articles`.*, `User`.`name` AS `User.name` FROM `#_content` AS `Articles` INNER JOIN `#_users` AS `User` ON Articles.created_by=User.id
Should it be Articles.title for working ?
I tried a lot of things, using custom code to find the problem, but I can't display correctly the User.name column. I succed getting User array in my Articles array and I am sure that the sql query works, so may be the problem is in the data display fields box with User.name:Author but I don't know what to write instead of.
As a last resort, I could use custom code to it๐
Thx for taking few minutes for helping me and translate me ... Sorry, english isn't my mother tongue .