Login form in php and mysql | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Login form in php and mysql

I have a login form for client and freelancers. For the login checking both the tables of freelancer and login. Is there anyway, to seperate the fetch like for client it should with client table only and for freelancer it should check with freelancer table only. I can't make two login form. Thanks in advance.

29th Apr 2020, 8:46 AM
Learner
11 Réponses
+ 3
The simplest thing you can do is to make a selection, which will include the types of users. For example : employer and freelancer. Then you can use it to select a specific table.
29th Apr 2020, 5:29 PM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 1
So employer and freelancer both are going to login through the same form. From email only how will I get to know whether it is of freelancer or employer that is why I am checking in both?
29th Apr 2020, 5:22 PM
Learner
+ 1
Yeah but in login form we are having two fields email n password
29th Apr 2020, 5:42 PM
Learner
+ 1
I guess I can use radio button to segregate freelancer n client that will be helpful right?
29th Apr 2020, 5:52 PM
Learner
+ 1
That is exactly what I was saying ;)
29th Apr 2020, 5:53 PM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 1
Ooh Thank you then :). May I discuss one more query regarding showing error in registration form by using php and mysql
29th Apr 2020, 5:55 PM
Learner
0
How to select I did not understand.
29th Apr 2020, 5:41 PM
Learner
0
Aren't you allowed to use more than two fields?
29th Apr 2020, 5:45 PM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
0
Sure thing ;> Write it down.
29th Apr 2020, 5:57 PM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
0
I got toggle for freelcr and clnt. On hovering they are displaying different forms. So when I am directing errors from backend using header func of php it is using address of the page in which both forms are present. For freelncr it is working properly but for client it is first displaying freelncr then when I am.hovering over client then only it is showing error. Only solution I have is to on hovering I should direct to another page do from.this way we can have different urls which I needed for displaying errors.
29th Apr 2020, 6:03 PM
Learner
- 1
Ofcourse you can make so. You can make two separate tables. One for the 'freelancers' and another for the 'clients'. You can then write the sql like so: $sql = "SELECT * FROM TABLE_NAME"; to select all the rows in the table. Furthermore, you can now make query for your login system using the specific table.
29th Apr 2020, 5:18 PM
Arb Rahim Badsa
Arb Rahim Badsa - avatar