by Ignacio Boado Diego.
In case someone gets to the same problem, i finally figured out what was going on:
I found that there is a table called "mdl_enrol", wich contains the 3 types of enrolments available for each course, each one having it's own ID (As every other single table, an autoincremental field).
So, for example, the course I mentioned in the post above, has 3 rows in this table, one having the info for a "manual" enrolment, another for "self" enrolment info and the last one for "guest" enrolment info. Each of this rows having an ID, wich is the one that should be used to manually insert data in the "mdl_user_enrolments"
Hope this is helpful to anyone.
Thanks!