First, I must say that your query is vulnerable to SQL injection. This is because you are essentially trusting the user's input, by setting the post variables in the query. You can see how to prevent injections below.
How can I prevent SQL injection in PHP?
I am not sure why you would want to overwrite a user's ID with it's username. I suggest having a user table, where each user has a row, and the ID of that table would then become the user's ID.
EDIT
You wouldnt have to worry about the user remembering their userID. You can use the username submitted from the front end to find out the userID for backend processing:
$result = SELECT userID FROM users WHERE username = $username
You can then use the userID from the result to perform the user actions and then report to the user using either their first name, or their username.
EDIT
Upon user creation, we do not need to implement the use of the username within the birds
table (as we are just creating the user).
Once a user is logged in (by querying the user table) to verify that the username and password is a match, you could create a $user
global variable that stores the username. When a user goes to the form to submit their favorite bird, you can use that global $user
variable containing the username to insert into the bird
table.
This is where you would do:
$result = "INSERT INTO birds (column1,column2,column3,...) VALUES (value1,value2,value3,...)";
Keeping in mind the id
on the table will increment itself.
For a MySQL table, you NEED some sort of unique identifier. For the purpose of the birds table, you could have a simple id
that just automatically increments everytime a bird is added.
Hope this helps.