a Little late but the following to point you in the right direction -
Your code is very "loose" and mixed, there are many easier ways to echo out values to see if a correct item(character, array, variable etc) is returned from a line of code, the best is by using error trapping by using try-catch blocks as you did in your code -
if ($link -> connect_errno) {
echo "Failed to connect to MySQL: " . $link -> connect_error;
exit();
} else {
echo "Connected successfully";
}
If you do this with all of your variables, it will make life so much easier, as an example -
/ Example variables
$var1 = 42;
$var2 = "Hello, World!";
$var3 = true;
if (isset($var1) && isset($var2) && isset($var3)) {
echo "All variables exist.";
} else {
echo "At least one variable does not exist.";
}
if (isset($var1, $var2, $var3)) {
echo "All variables exist.";
} else {
echo "At least one variable does not exist.";
}
The next will be to use PHP's error checking on each of your PHP pages, this will show you errors that you have not even realized exist in your code. This must be placed at the top of each page, keep in mind to always disable this when not developing -
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
Now to your error, using the above -
First check that each variable 'NAME', 'EMAIL', PASSWORD' actually has a value, else show an error message. If they do have values, the crash probably occurs at the 'b' value, PHP will never read a variable called 'b' as it need to be identified by the '$' operator. Fix this and you should be good to go -
What are the naming conventions of variables in PHP?[
^]