So I started an PHP login system, and the login works, but when I try to make a registration form, it just won’t work. I have a database table named members, and it has three columns, named id, username, and password. The HTML is this.
hi, you are missing a ’ before $newusername in your query string.
Echo out a mysql error message to give you a clue as to what is happening.
eg
mysql_query("INSERT INTO members(id, username, password) VALUES(' ', $newusername', '$newpassword')") or die(mysql_error());
Also as a piece of advice, please look at SQL Injection as your query is using USER SUBMITTED input directly into your database query.
This could easily lead you into difficulties in the future as a hacker would have direct access to manipulate your database.
Specifically look at mysql_real_escape_string().
If youare just starting out with mysql, look at using PDO instead: http://php.net/pdo