I had xmlapi code before 1.5 years ago and working perfectly till 6 months before. Suddenly, it stopped working with no error. Now, I read that xmlapi has been deprecated and uapi is being used. Now, I prepare code as per - cpanel-UAPI-php-class with no error but both xmlapi and uapi could not create database.
Is it possible to make database dynamic as we do in local machine(using query)? Or any other way to work permanently.
You can use cPanels LiveAPI class to achieve this:
Don't forget that if database prefixing is enabled,
newdb
will need to also include the username. For example,cpuser_newdb
.More info:
https://documentation.cpanel.net/display/DD/UAPI+Functions+-+Mysql%3A%3Acreate_database https://documentation.cpanel.net/display/DD/Guide+to+the+LiveAPI+System+-+PHP+Class