Hi when installing a cms, I want to create a database (by the php code) but in cpanel, when we create the database, we have to add the user to the database so is it possible to create the database by php code and add the user to it? thanks for your help.
Yes you can, but you need privileges. Did you ever use phpMyAdmin, it is PHP script, and from this script you can add databases and users, etc.
PHP can do anything the MySQL user it logs in as, has the privledges to do. http://dev.mysql.com/doc/refman/5.1/en/privilege-system.html To create databases, the user needs to have the CREATE privledge.