I have a Form on registration.html through which i trying to get data in mysql through the below php script but there is and mysql syntax error please help me with the below code.
<?php
$conn = mysql_connect("localhost", "onlinewe_meghraj", "password123")
or die(mysql_error());
$db = mysql_select_db("onlinewe_college")
or die(mysql_error());
$name1 = $_POST['name1'];
$name2 = $_POST['name2'];
$year = $_POST['year'];
$department = $_POST['deparment'];
$group = $_POST['group'];
$in_name = $_POST['in_name'];
$in_address = $_POST['in_address'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$mobile1 = $_POST['mobile1'];
$mobile12 = $_POST['mobile2'];
$comment = $_POST['comment'];
$result=mysql_query("INSERT INTO register (name1, name2, year, department, group, in_name, in_address, phone, email, mobile1, mobile2, date, comment) VALUES ('$name1', '$name2', '$year', '$department', '$group', '$in_name', '$in_address', '$phone', '$email', '$mobile1', '$mobile2', '".date("Y-m-d h:i:s")."', '$comment')")
or die("Insert Error: ".mysql_error());
echo "REGISTRATION DONE";
?>
Please reply. Thank you.