INSERT command denied to user 'xxx'@'localhost'

$populateadmissiontbl = ExecuteStatement(“INSERT INTO fabotasp_acceptance.users (name, firstname,middlename,email ,password,gender,mobile,designation,image,status,dept,Level,batch,fabotasexamno,admissionstatus,admissiontype,courseduration,course,dptcode)
SELECT name , firstname,middlename,email ,password,gender,mobile,designation,image,status,dept,Level,batch,fabotasexamno,admissionstatus,admissiontype,courseduration,course,dptcode FROM fabotasp_studentportal.acceptancetemp”);fails with error public_html/portaladmin/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php(101): An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1142 INSERT command denied to user ‘fabotasp_portaladtostudent’@‘localhost’ for table 'users’the user have the privilege.
when i run the same query in phpmyadmin , it worked

Although you said the user has the privilege, the error message clearly said not. You may want to double check the user privileges on the production server returning the error.If you created the ‘user’ table by another user, make sure the runtime user ‘fabotasp_portaladtostudent’@‘localhost’ has privilege.