I have this form where the users can save confidential information to database:
<h3>Saving Progress For Existing User</h3>
Your user id is the only way you can save, view and use your points, coupons and discounts.<br><br>
In order to save your points, enter your user id and username below: <br><br>
<form id="SaveProgress" name="SaveProgress" action="saveProgress" method="POST">
User ID:<input type="text" id="save_user" name="save_user" pattern=".{5,7}" required title="5 to 7 characters" value="" required>
Username:<input type="text" id="save_username" name="save_username" pattern=".{5,7}" required title="5 to 7 characters" value="" required>
<button style="border:none; padding:1%; cursor:pointer;" type="submit">Save My Points</button></form>
It is not a log in form, the user will not be directed to an account page, but for privacy and security concerns, the users are required to enter their USER ID and their username to inject updates in the database. If the username and USER ID match with existing entries, the data get injected, if not an error message will pop.
How do I check if the username and the user ID match with existing entries?