Now it works! Problem was the define('AJAX_SCRIPT', true); wich I got in a db topic here at the forum but it seems it was specific for that case. There was also the prefix "mdl_" that I forgot to remove from the table name.
Plus I corrected the code from $_POST to required_param().
You really saved me there.
Thanks Darko and Justin.