Logging in to a mysql database

Is it possible to connect to a mysql database and check if the user has bought the game?

Update: What is the client side code to do this?

Yes. Use WWWForm to make a request to your web server passing some details of the user. You’ll probably have a PHP script on the server which will call into your database.

Yes, as Graham said, you will call into a PHP script on your website. On the form you will need username and password. I’d suggest an encryption method of some sort, but that’s not required. You have the user type in their username/password in unity, post it to the PHP script… the php script queries the database for the username, makes sure the name matches the password, and then you can output information. I always output the information I need into JSON format. Yield the www form so that it waits for the download, and use www.text to retrieve the outcome of the php file.