I am making a registration system, and I wanted to check wether or not a Username chosen by the user has already been used and if it hasn't already been used, enter the chosen username into the DB?.
below is my query as it is so far, but I keep getting syntax errors. For the record: I am going to use BindParam() to bind the PHP input of the user into the query :)
I also have another column called "ID-number", which is a primary key.
Any help on how to do this is welcome!
Greets,
Romulus
SELECT CASE
WHEN `Username` != `Username`
THEN
INSERT INTO 'T_Users' `Username`, `Password`, `Email`
VALUES ':username', ':password', ':email'
END
FROM `T_Users`