i'm new user and still i'm studying the software
i was looking for a solution like the question of the topic
i'm intrested your solution,
so i ask help to get it better
i think i get the php file you posted
I create a specific table that i use for the list options
when someone update the table (for example insert something) i have a hook with php code that fire the script
the script make a query to the mysql and get all the values inside
then the script open the csv file and override all the values inside
at this point if I use somewhere the option list associated to the csv file i get the new values
what i dont understand well is how associate the option list to the csv file
because in app gini it seems i neet to write values separated by a double semicolon like this ;;
so do i need here to write the url or the name of csv?
i dont' get this point
i dont' get exactly what i need to write in place of the list separated by semicolon;;
also i need to setup it like blob or text?
in documentation i didnt find possibilty to use a csv file there,
so it's point not clear to me
thanks
Bertv wrote: ↑2018-04-27 15:36
You have to use a csv-file for the options.
optionlist.png
In the the table with the options you have to create the options csv file int the after insert and after update hook.
See below an example:
function adm_mail_groepen_after_insert($data, $memberInfo, &$args){
// stel de mailgroepenlijst t.b.v.mailingen opnieuw samen
$csvfile = "adm_mailingen.mln_mailgroep.csv";
// - stel de mailgroepenlijst opnieuw samen
$sql_string = "SELECT mgr_naam
FROM adm_mail_groepen";
$resultaat = sql($sql_string, $eo);
$num_rows = db_num_rows($resultaat);
$list = "";
if ($num_rows > 0) {
while ($rij = db_fetch_array($resultaat)) {
if(!$list) {
$list = $rij["mgr_naam"];
} else {
$list = $list . ";;" . $rij["mgr_naam"];
}
}
}
// - save de csv-file
$file = fopen("hooks/$csvfile", "w");
fwrite($file, $list);
fclose($file);
return TRUE;
}