I wrote some code for my login and registration system. In my registration system, I have included this code:
<?php
$sql3="UPDATE users SET
firstname='$firstname', lastname='$lastname',
password='$password',bio='$bio',
dob='$dob',gender='$gender'
?>
But of course, this just updates all rows in the users table. But when I add:
<?php WHERE username=$username ?>
I will get an error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1.
Let me be clear, this is NOT an error question, I know what the problem is. I just want to know how to troubleshoot my code so that it doesnt update the whole table instead of just one users row. Thank you in advance.