The essence of the question is: is there a website on which people purchase a subscription. There are 2 types of membership and depending on the choice users are given access to certain pages. To solve this problem I decided with help of 2 tables and signup signup1. Each contains the field user_id username password.
A person buys a subscription and it comes depending on the purchase the login and password of the corresponding table. Connect to one table on submit I could do, it looks like this:
But how to connect the second table here generally is not present. That is, it should approximately be: if one table has no match, the handler must check the second and give the answer.
Unfortunately PHP is not strong, searched the Internet nadybal like this to happen you need to do so:
But it doesn't work. Ask the Board summarized the people.
The title of the question "Working with two Mysql database in Php?" is not correct. You use one database but two tables.
In fact it is wise to use ONE table. And in it add a field , something like
subscription_type. Then you won't have to look first at one and then at another table. And if you have another subscription type, you will be a third table to create and search for three ? )).
So : one table and as many subscription types. Consequently, working with this ONE table that you already know.
"SELECT `user_id` , `username` FROM `signup`, signup1` WHERE username = '$user_username' AND password = SHA('$user_password')" . - never insert user input directly into a query! This is another mortal sin. The placeholders, PDO - give hope ))