Please could someone check this code for me as it is giving me You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near line .
Although this type of question has been ask by someone else before, but every ones code is different. thanks in advance.
$username="***********";
$password="******";
$database="member";
$conn= mysql_connect($servername,$username,$password,$database)or die(mysql_error());
mysql_select_db("datas",$conn);
if (!$conn) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_select_db($database);
$sql="insert into datas(firstname,lastname,email,password,repassword,address)
values('$_GET[firstname]','$_GET[lastname]','$_GET[email]','$_GET[password],'$_GET[repassword],'$_GET[address])";
$result=mysql_query($sql,$conn) or die(mysql_error());
print "<h1>you have registered sucessfully</h1>";
print "<a href='index.php'>go to login page</a>";
}
else print "passwords doesnt match";
}
else print"invaild data";
?>