Hi,
I'm trying to add code to compare 2 values from diferent tables.
Imagine I have a
Table1
----------
seller_id
seller_number
Table2
----------
Buyer_id
buyer_number
First I don't want sellers become buyers and buyers become sellers, so I have 2 diferent tables for users.
This seller_number and buyer_number is like the personnal ID number that users must add while registering.
I've successfully coded for fetch the database in case of repeted number, but only for sellers and other for buyers...
Now I want:
- If a user is trying to register with a number existing in table1 and existing in table2 do not allow and send warning message, or
- If a seller is trying to register as buyer, checks number in both tables and if exist, do not allow and send warning message, or
- If a buyer is trying to register as seller, checks number in both tables and if exist, do not allow and send warning message.
Basicly, it fetch both tables and compare existing numbers with that is trying to be added...
Any help, idea?
Please?
Thanks