Is it possible to a single database across multiple websites on different servers? What I am trying to do is.
For example I have website A and B I have this online store website for example A and i want to allow only users of store A who have purchased this certain product from store A to access Website B. Website A and B are both on different servers.
So I want to run mysql queries on website B at the login page like ... select all the users from website A who has purchased this product are allowed to log in.
Any ideas will be appreciated.
Doing this is possible. PHP connects to a database using a host name or IP address, port number, database, DB user name and password. Usually DB connections are limited to the same server (i.e. only a script that calls the database from the same server can connect. If your hosting provider allows you to change this (which would be insecure, that's why it's limited) you can connect to a central DB from wherever you want.
As long as database access is open to the IP of site B, you just have to figure out the queries and you're good to go.