Here u can fuond an example of a passwd for pam_mysql.so.
I suppose you save users in a table called "users".
This implementation resolve my particular case, but i would trust it can help you.
We can have a better implementation if you implement mysql statement.
Anybody can help to improve my sourcecode.
thx 4 all.