You have many issues in your source code:
1. what is your test_input function. How come it can validate name, password, email?. You need to define separate validator for name and email. Name can contain space but mail can't;
2. your preg_match will allow empty name to pass through.
3. What's the point of password_2?
4. When you check for existence of email and password together, it will give a window to hacker to find password with brute-force attak
5. You cannot use break or default or default in main body
PHP: break - Manual[
^]
6. May be use md5 function of mysql, not php.
7. Your insert query does not use ENCRYPTION. If you can successfully add in the database, your password will be registered as unencrypted
8. You insert query is not secured. Insecure insert query will compromise the security of your entire system. Read about
SQL inject[
^]