i am trying to put form data to mysql table
what's wrong with my code below does not give any error but not inserting any data in table
<html>
<head>
<title>HTML formS</title>
</head>
<body>
<form action="insertform.php" method="post">
Name : <input type="text" name="name"><br>
address : <input type="text" name="address"><br>
topic :<input type="text" name="topic1"><br>
<input type="submit" value="submit">
</form>
<?php
$name = $_POST['name'];
$address = $_POST['address'];
$topic1 = $_POST['topic1'];
if (isset($_POST['submit'])){
$con = mysql_connect("localhost","db","password");
if (!$con){
die("can not connect".mysql_error());
}
mysql_select_db("db",$con);
$sql= "INSERT INTO student_register_test10 (name, address, topic1) values ($name, $address, $topic1)";
mysql_query($sql,$con);
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "Success!";
mysql_close($con);
}
?>
</body>
</html>