To publish my table, i need the query: SELECT * FROM `klanten` LEFT OUTER JOIN `generators` ON (`klanten`.`klant_gen` = `generators`.`gen_id`) LEFT OUTER JOIN `businesses` ON (`klanten`.`klant_bs` = `businesses`.`bus_id`)
And i need the outer joins to also publish records from klanten that have no matching records in genersators and/or businesses.
I ve been looking around but cant find a way to use the outer. i can do the normal left and right in the 'default query configuration' (which implies there is a 'not default or special' one too. Cant find it ...thanks for help
What i cant find either, are posibilities to manipulate queries or parameters in 'before show''before publish' etc clauses. please help
Thanks for the help. But this is exactly what i did, without the right result but with the result i described, so please check if in the latest download version this still functions properly. Because i did tyhis exactely in the example i documented in the forum i use the table generators and not nationalities. The table has an ID and a name. I fill in the form exactely as you describe and in the add page i get something that looks right, but if i use chrome inpect i see that the options look like this <option value="$name">$name</option>, so the value, or ID from the table dissapeared. Selecting this i want to add a record in the table klanten with the value generator, being the selected value of the selected option. As this is, because of what i call a bug (specially now i know i set the right steps) it tries to store the label:$name. So it stores null. In the edit page the select has the same problem and besides it ads a first option with the value of generator from the first record of klanten. If its not clear, tell me ill make a recording of what i am doing.
Oh Ooh, also the other options to fill the select are not ok! int the 'enter value' option, the is still that first line selected with no value and label 1
To give a hint, in the custom page we find within the Select as first option: <option selected><?php echo $data['klant_gen']; ?></option> This causes the frist option: <option selected="">2</option>; I cant see a reason to have this line here, it should not be Then in the loop for all the array content: <?php $rec = $data['klant_gen']; $klant_gen_options = $comp_model -> klanten_klant_gen_option_list(); if(!empty($klant_gen_options)){ foreach($klant_gen_options as $arr){ $val=array_values($arr); $selected = ( $val[0] == $rec ? 'selected' : null ) ; ?> <option <?php echo $selected; ?> value="<?php echo $val[0]; ?>"><?php echo (!empty($val[1]) ? $val[1] : $val[0]); ?></option>
I think this is a kind of mix-up by using array_values($arr), you loose the value => label relation. Lets see, in my table I have two pairs (ID,Value) for now: 1=>Casius and 2=>Werkspot. What happens in this piece of code? The val array will look like [0] => Casius, [1]-> Werkspot. so the line <option <?php echo $selected; ?> value="<?php echo $val[0]; ?>"><?php echo (!empty($val[1]) ? $val[1] : $val[0]); ?></option> will end up in two options where value and label are equal and the original value from the database table is lost. I think you want to have a code for both 1 column and two colomn arrays. In this way you loose the intended relationship.
What i would like to have at this point, is a twodimensional array, derived from the database table : 1=>Casius; 2=>Werkspot.
Then the code to create the options would be : foreach($array as $value => $label){ <option <?php echo $selected; ?> value="<?php echo $value; ?>"><?php echo $label; ?></option> } Which would give me the optionslisting. So to workaround (though i really think this should be a standard field) is to have such an array.
following select was created by the optionListDataSource property of a form field: <select id="ctrl-klant_gen" name="klant_gen" placeholder="Selecteer een waarde" class="custom-select"> <option selected="">2</option> <option value="Casius">Casius</option> <option value="Werkspot">Werkspot</option> </select>
This was the generated DataSource Query: ""SELECT DISTINCT gen_id AS value,gen_naam AS label FROM generators ORDER BY gen_naam""
Only the DISTINCT checkbox was ticked.
Nothing wrong with the query, but how it is internally presented to create the select, must go wrong. The first (selected) option, is the present value of the field in the first record in the table. Shouldnt be in the select at all. Then the values equal the labels in option 2 and 3, which is not correct. This should have been the correct select:
Suppose you have a data table 'customers'. Those customers have a property: nationality . To have users make similar choices, we can use a select with certain values as index and a description as text. I want to store an integer only, so not the text, in the customer table field nationality. I create another table: nationalities. There i store an ID and a descrpition. In the add and edit customer pages, i want the select filled with the index/value from the table nationality. In the other customer pages i want to see only the text, not the index.
EG both 'php generator for mysql' and 'Code Charge Studio' have a standard field option called 'Lookup field'.
Suppose you have a data table 'customers'. Those customers have a property: nationality . To have users make similar choices, we can use a select with certain values as index and a description as text. I want to store an integer only, so not the text, in the customer table field nationality. I create another table: nationalities. There i store an ID and a descrpition. In the add and edit customer pages, i want the select filled with the index/value from the table nationality. In the other customer pages i want to see only the text, not the index.
EG both 'php generator for mysql' and 'Code Charge Studio' have a standard field option called 'Lookup field'.
Suppose you have a data table 'customers'. Those customers have a property: nationality . To have users make similar choices, we can use a select with certain values as index and a description as text. I want to store an integer only, so not the text, in the customer table field nationality. I create another table: nationalities. There i store an ID and a descrpition. In the add and edit customer pages, i want the select filled with the index/value from the table nationality. In the other customer pages i want to see only the text, not the index.
EG both 'php generator for mysql' and 'Code Charge Studio' have a standard field option called 'Lookup field'.
Suppose you have a data table 'customers'. Those customers have a property: nationality . To have users make similar choices, we can use a select with certain values as index and a description as text. I want to store an integer only, so not the text, in the customer table field nationality. I create another table: nationalities. There i store an ID and a descrpition. In the add and edit customer pages, i want the select filled with the index/value from the table nationality. In the other customer pages i want to see only the text, not the index.
EG both 'php generator for mysql' and 'Code Charge Studio' have a standard field option called 'Lookup field'.