Hi All
Absolute newbie here, been using PHP for about three months, yes this is a homework project, yes there are a ton of mistakes, yes I may be open to SQL Injection but this is a total homework project on my laptop and destined never to go anywhere.
I have written two custom functions to check a login via a html form.
All works well but now I have decided I want to check what type of user is logging in to direct the users to a different page, eg: Standard user goes to one page Admin user to a different.
So this code works just fine:
Finds the users email and logs the user in with the correct email so I get a different user for each email.
However, what I want to do now is pass the type of user FK_UserTypes_Id which will be a 1, 2 or 3 etc.,
I thought I would just be able to add a variable of usertype and the SQL would pull that value into my new variable
I can then use this further down the coding
However as soon as I introduced another parameter I get this error message:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function find_user_by_username(), 1 passed in C:\laragon\www\auth\src\auth.php on line 160 and exactly 2 expected in C:\laragon\www\auth\src\auth.php:1
I have run the SQL many times and the fk_User_Id does return for the email provided.
I'm learning so I'll continue to delve and try stuff but this has had me more stumped than any problem in PHP I have encountered so far.
Many thanks for looking
G