I have a problem connecting to MySQL database with PHP I am using WAMP I created a database in my PHPMyAdmin I made my connection via PHP but this error appears when I click send in my form
:
Thesearethecodesformyconnection:
config.php
<?php$db['server']='localhost';$db['user']='felipe';$db['password']='lalala';$db['dbname']='base_teste';//estabeleceumaconexaocomserverdebd('servidor','usuario','senha')$conn=mysql_connect($db['server'],$db['user'],$db['password']);//conexaocombancomysql_select_db($db['dbname'],$conn);?>
funcoes.php
<?phpfunctionadicionar($nome,$idade){$sql="insert into tb_alunos (nome,idade) values ('$nome','$idade')";
mysql_query($sql);
}
?>
add.php
<?php
include 'config.php';
include 'funcoes.php';
adicionar ($_REQUEST['nome'],$_REQUEST['idade']);
?>
index.php
<!DOCTYPE html>
<html>
<head>
<title>conexao teste</title>
</head>
<body>
<form action="adiciona.php" method="post">
nome <input type="text" name="nome">
Idade <input type="text" name="idade">
<input type="submit" value="Enviar">
</form>
</body>