I am trying to think through a script that I need to create. I am most likely going to be using php unless there would be a better language to do this with e.g. python or ror. I only know a little bit of php so this will definitely be a learning experience for me and starting fresh with a different language wouldn't be a problem if it would help in the long run. 
What I am wanting to do is create a website where people can sign up for WordPress hosting. Right now I have the site set up with WHMCS. If I just leave it how it is I will have manually go in and install WordPress every time a customer signs up. I would like an automated solution that creates a database and installs WordPress as soon as the customer signs up. With WHMCS I can run a script as soon as a customer signs up and so far I understand how to create a database, download WordPress, and install WordPress. The only thing is I can't figure out how to make it work with more than one customer because with each customer there will be a new database. What I need the script to do is when customer A signs up,  the script will create a database name "customer_A" (that name is just an example) and when, lets say my second customer signs up, the script will create a database named "customer_B". 
Is there a possible solution to this?
Thanks for the help
I did this yesterday.
my process was to add a row to a master accounts table, get the auto inc id, use that along with the company name to create the db name. so in my case the db's are 
Root_1companyname1
Root_2companyname2
..
Root_ is optional of course.
Ask if you have any questions.
Automate database creation with incremental name?