If I understand you correctly, then the answer is YES.
You want to create a MySQL user (not just a userid for some website) that has access to a database created on demand (such as a registration script)
So if user peg110 signs up you would create a user in the mysql table along with a database (for example) called peg110 that user peg110 has full control of.
If this is correct then you can do all the same commands that you could/would do in phpMyadmin. If you notice on every command that you do in phpMyadmin, it will give you the SQL syntax. You could perform the SAME query (as adjusted by the script) for CREATE USER, CREATE TABLE, and the grants (as needed). You would then use the same mysql_db_query that you would use as in the example above.
The one thing that you need to make sure of is that the userid that you use in the mysql_connect string has the appropriate permissions to perform the create and grants that are needed.
Hope that makes sense and helps.