Forums

Troubleshoot configuring a multi setting database

christones 07 Aug, 2014
1 Likes
Hello Sir,
i am a developer and im working on real estate website development. The real estate company works on projects of houses construction and community establishment. Each project involves a lot of product that are to be sold to customers. I therefore came out with two database tables linked through a one-to-many relation.There is the migration of the primary project key from its original table to the products tables. The relation is configured in the Multi table settings interface and the custom code i placed in the "body" part of the Front end list settings intends to publish each project name followec by the corresponding products. This is the custom code :
{proj.nom}
{proj.produit.nom}


where proj is the model id of the table project
and produit is the model id of the table product

BUT at runtime the system retrieves all the projects table's attribute without getting any from the products table

this is what the debug mode looks like :
Array
(
    [Approx_Memory_Usage] => 775680
    [Approx_Time] => 0.044912099838257
    [SQL] => Array
        (
            [0] => SELECT `proj`.`cf_id` AS `proj.cf_id`, `proj`.`nom` AS `proj.nom`, `proj`.`superficie` AS `proj.superficie`, `proj`.`datedispo` AS `proj.datedispo`, `proj`.`description` AS `proj.description` FROM `jcv8j_chronoforms_data_formulaire_projet` AS `proj` ORDER BY `proj`.`cf_id` LIMIT 0,5
            [1] => SELECT `produit`.`cf_id` AS `produit.cf_id`, `produit`.`nom` AS `produit.nom` FROM `jcv8j_chronoforms_data_formulaire_produit` AS `produit` WHERE `produit`.`idprojet` IN ('1','2','3','4','5')
        )

    [data] => Array
        (
            [0] => Array
                (
                    [proj] => Array
                        (
                            [cf_id] => 1
                            [nom] => Kribi premium
                            [superficie] => 10000
                            [datedispo] => 2014-08-23
                            [description] => 

Ce projet est un projet des projets de communauté aménagée.Il est localisé à Kribi et incorpore d'innombrables produits commandable de façon composite ou en agrégation ou même encore de façon atomique.Ce projet est un projet des projets de communauté aménagée.Il est localisé à Kribi et incorpore d'innombrables produits commandable de façon composite ou en agrégation ou même encore de façon atomique.

                        )

                    [produit] => Array
                        (
                        )

                )

            [1] => Array
                (
                    [proj] => Array
                        (
                            [cf_id] => 2
                            [nom] => sdqfsdf
                            [superficie] => 10000
                            [datedispo] => 2014-08-17
                            [description] => 

Description détaillée du projet

                        )

                    [produit] => Array
                        (
                        )

                )

Please how can i fix the problem .
Max_admin 09 Aug, 2014
Hi christones,

I think its a misconfiguration at the "foreign key" section, because the sql statements were executed but the data could not be matched, which means that either the 2nd query returned 0 results or the results couldn't be associated, so please check the foreign key and make sure that the 2nd table has some rows matching the records of the 1st one.

An easy way to test this is by setting the relationship to "One to One", but in this case you will get only 1 record, but it will test the foreign key!

I also suggest that you install and test v5, because on the long run it should be better!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.