When my registration form tries to insert with user1 (which has been granted ALL PRIVILEGES) it works. But when I try to insert with user2 (which has also been granted ALL PRIVILEGES) it won't insert. I don't get any errors and have been troubleshooting for a couple of hours now and can't find a problem, better yet a solution.
User2 didn't have all privileges (like any sane person should do of course). When I tried granting it all privileges it still couldn't insert while user1 which has the same privileges can.
As I don't know where the problem is, I can only include the database connection code which seems to be right. If anything else is needed I'd gladly put it here.
$dbservername = "localhost";
$dbusername = "user1";
$dbpassword = "password1";
//$dbpassword = "password2"; (I keep this here to change users fast when troubleshooting and yes I change the username everytime)
$dbname = "database1";
$db = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
I expected user2 to insert into the database but it won't. I don't have any error messages.
Privileges:
EDIT:
I have tried running the code Martin gave and both users connect...