Are you doing this on your own machine? I would guess so, but if not logging on as any user or root without a password isn't very secure.
Look up in the manual how to GRANT a user privileges in the database including setting a password for them. Then use a user you specifically set up with the user and password you gave them when you are testing from a PHP application.
For some reason the default in mysql setup is to allow any user to connect from anywhere without a password.
but got this error message? I'm not sure what to do now...
mysql> --user=root mysql
mysql> grant all privileges on *.* to 'myname'@'localhost'
-> identified by 'mypassword' with grant option;
ERROR 1045: Access denied for user: '@localhost' (Using password: NO)