I am getting an error querying database but I am sure my code is correct and I have tried to debug the code but its not detecting any errors.
Here is the code below I have removed the password bit
<?php
$fname = $_POST['firstname'];
$lname = $_POST['lastname'];
$team =$_POST['team'];
$position = $_POST['position'];
$other = $_POST['other'];
$contact = $_POST['contact'];
$dbc = mysql_connect('localhost','******', '***********')
or die('Error connecting to Mysql Server'.mysql_error());
mysql_select_db("tester1",$dbc);
if(!$dbc){
die("you have entered a wrong details please try again" .mysql_error());
};
$query ="INSERT INTO trail1 (first_name,last_name,team,position,other,contact)" .
"VALUES ('$fname','$lname','$team','$position','$other','$contact')";
$result = mysql_query($query) or die('Error querying Database');
mysql_close($dbc);
?>