Would that write to the MySQL db all the information I need?
First of all, as you may know, that is SQL--not PHP--so you would need to make sure to encapsulate it in an appropriate PHP function. I recommend reading the PHP manual for its handy MySQL functions:
http://www.php.net/manual/en/ref.mysql.php
The PHP manual is a great resource for learning how various things work. Of course, as with most or perhaps even all such large documents, there are some errors, but overall the information is very useful.
Before I go any further, I would like to offer some advice:
Never trust the client! Validate everything and try to catch all possible errors. Doing so will make coding take longer and it will have an ever so slight effect on execution time (probably unnoticeable in most cases), but the benefits far outweigh the potential consequences.
Also, how would I make sure it didn't overwrite something else every time I inserted data. How do I make sure it gets put on a separate part of the table?
I do not think you understood my analogy in my previous post. How do you know the hostess at a restaurant is not going to overwrite your name on her list with the name of the next person who walks in? She just knows to put it on the next line. Even if you had the same name and party size as the person, she could write their information on a blank line without making yours disappear. Then she would have to ask who arrived first, but do you understand where I am going with this?
Take a handful of coins. Put one in your pocket. Now put another one in your pocket. Did the first one disappear?
Just as you do not need to worry about your name being overwritten on a restaurant waiting list and you do not have to worry about coins overwriting coins in your pocket (or worse--overwiring your keys), you do not have to worry about overwriting data in a database with an insert command. The "insert" command is for inserting new data only; you only have to worry about overwriting data if you are updating records with the appropriately named "update" command.
Now that you understand this (I hope), I can tell you about preventing yourself from entering duplicate records. This is done with what is called a "primary key", which is just a unique value in a particular column. There is a lot more to learn than I can teach you in these little posts; I definitely recommend reading up on SQL in general
and MySQL in particular. However, to be honest, I would forget about PHP for a few days if I were you. You should try designing some databases then inserting, selecting, updating, and deleting data. Once you are comfortable with SQL, figuring out how to run queries through PHP is fairly trivial.