I am a beginner in PHP and I can not resolve this error, thank you for your answers.It is a simple connection to a database in MySQL with columns:
Name
Last Name
Email
Parse error:
syntax error, unexpected '""' (T_CONSTANT_ENCAPSED_STRING), expecting variable (T_VARIABLE) or '{' or '$' in C:\xampp\htdocs\Suscribe\registro.php on line 7
$db_host="localhost";
$db_user="root";
$db_password="";
$db_name="prueba";
$db_table_name="datos";
$db_connection = mysql_connect("$localhost", "$root","");
if (!$db_connection) {
die('No se ha podido conectar a la base de datos');
}
$Nombre = utf8_decode($_POST['nombre']);
$Apellido = utf8_decode($_POST['apellido']);
$Email = utf8_decode($_POST['email']);
$resultado=mysql_query("SELECT * FROM ".$datos." WHERE Email = '".$Email."'", $db_connection);
if (mysql_num_rows($resultado)>0){
header('Location: Fail.html');
}else{
$insert_value = 'INSERT INTO `' . $prueba. '`.`'.$datos.'` (`nombre` , `apellido` , `email`) VALUES
("' . $Nombre . '", "' . $Apellido . '", "' . $Email . '")';
mysql_select_db($prueba, $db_connection);
$retry_value = mysql_query($insert_value, $db_connection);
if (!$retry_value){
die('Error: ' . mysql_error());
}
header('Location: Success.html');
}
mysql_close($db_connection);