so i use this code to autonumber some fields. works fine. but there is some limit in the concat. i’ve red that it was limited to 1500 but in scriptcase it’s much more limited, i think.
in other words, not each record is included in the var and i can’t find no option or anything to expand the number of items in the var or the concat. any suggestions?
$a = {START}+1;
/*
somewhere i have to activate this ==> SET SESSION group_concat_max_len = 100000;
*/
// Check for record
$check_sql = “SELECT GROUP_CONCAT(wk_id SEPARATOR’,’)”
. " FROM ILP_rooster"
. " WHERE ev_id = [ev_id] AND ronde_id > 1";
//. " ORDER BY ronde_id";
sc_lookup(rs, $check_sql);
if (isset({rs[0][0]})) // Row found
{
{rooster_id} = {rs[0][0]};
}
else // No row found
{
//{rooster_id} = ‘’;
}
$rooster_id = {rooster_id};
$rooster_var = (explode(",",$rooster_id));
//echo ‘-’; print_r($rooster_var); echo ‘-’;
foreach ($rooster_var as $wk_id) {
// SQL statement parameters
$update_table = ‘ILP_rooster’; // Table name
$update_where = “wk_id = ‘$wk_id’”; // Where clause
$update_fields = array( // Field list, add as many as needed
“wk_eduarte_lesnr = $a”,
);
// Update record
$update_sql = ‘UPDATE ’ . $update_table
. ’ SET ’ . implode(’, ', $update_fields)
. ’ WHERE ’ . $update_where;
sc_exec_sql($update_sql);
/*
echo " ==> ";
echo $wk_id;
echo " - ";
echo $a;
echo " | ";
*/
$a++;
}
/*
- This macro shows a Javascript alert message screen.
*/
$params = array(
‘title’ => ‘Lesnummers gekoppeld’,
‘type’ => ‘success’,
‘timer’ => ‘2000’,
‘showConfirmButton’ => false,
‘position’ => ‘center’,
‘toast’ => false
);
sc_alert(“Nummers succesvol gekoppeld”, $params);