2
Well I’m trying to make a "Registration System with PHP and Mysql" I did this by following all the instructions I gave but at the time of the result it returns the following message.
Parse error: syntax error, Unexpected 'mysql_query' (T_STRING) in C: wamp www Formulario cadastrado.php on line 25
Below goes my code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Formulário de inscrição</title>
</head>
<body>
<?php
$host = "localhost";
$user = "root";
$pass = "";
$banco = "cadastro";
$conexao = mysql_connect($host, $user, $pass) or die (mysql_error());
mysql_select_db($banco)or die(mysql_error());
?>
<?php
$nome = $_POST['nome'];
$sobrenome = $_POST['sobrenome'];
$dataNasc = $_POST['dataNasc'];
$telefone = $_POST['telefone'];
$email = $_POST['email'];
$bairro = $_POST['bairro'];
$comentarios = $_POST['comentarios'];
$sql mysql_query("INSERT INTO funcionarios(nome, sobrenome, nascimento, telefone, email, bairro, comentarios)VALUES('$nome', '$sobrenome', '$dataNasc', '$telefone', '$email', '$bairro', '$comentarios')");
?>
</body>
</html>
And now a print that I think can help...
Then you could help me find the mistake?
Welcome. Do not use Stacksnippets for PHP code. PHP does not work on it, the boxes are marked with css/js/html so just post this inside them. For questions with code that cannot be reproduced via browser use the icon that looks like this
{ }
. Do not use title, Beginner, Helping, Help, Please. Use intuitive titles that have to do with the problem, follow the example of the other questions you can see on the home page.– Guilherme Nascimento
Enjoy and see the php wiki there are some good tips and materials to start.
– rray