//This is my php code. i am trying to store data in a table using php and mysql using post method in html form tag but it shows an error that query is empty. i have just started to learn php so might be a dumb one but plz help me with it
<?php
define('DB_NAME', 'db1');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_HOST', 'localhost');
$link= mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if(!$link){
die('Could not connect:'. mysql_error());
}
$db_selected=mysql_select_db(DB_NAME,$link);
if(!$db_selected){
die('Cant use' .DB_NAME. ';'. mysql_error());
}
$value1="";
$value2="";
$value3="";
$value4="";
$value5="";
$value6="";
$value7="";
$value8="";
$value9="";
$value10="";
$value11="";
$value12="";
$value13="";
$value14="";
$value15="";
$value16="";
$value17="";
$value18="";
$value19="";
$value20="";
$value21="";
$value22="";
if(isset($_POST['submit'])){
$value1=$_POST['Full Name'];
$value2=$_POST['Fathers Name'];
$value3=$_POST['Mothers Name'];
$value4=$_POST['DOB'];
$value5=$_POST['Gender'];
$value6=$_POST['Marital Status'];
$value7=$_POST['Husbands Name'];
$value8=$_POST['Category'];
$value9=$_POST['Sub-Category'];
$value10=$_POST['Nationality'];
$value11=$_POST['Religion'];
$value12=$_POST['Address'];
$value13=$_POST['Mobile no'];
$value14=$_POST['Email-ID'];
$value15=$_POST['Exam passed'];
$value16=$_POST['Board'];
$value17=$_POST['Passing Year'];
$value18=$_POST['Percentage12'];
$value19=$_POST['Migcir'];
$value20=$_POST['ProofDOB'];
$value21=$_POST['Marksheet'];
$value22=$_POST['GapCertificate'];
}
$sql= mysql_query ("INSERT INTO cslist(Full Name, Fathers Name, Mothers Name,DOB,Gender,Marital Status,Husbands Name,Category,Sub-Category,Nationality,Religion,Address,Mobile no,Email-ID,Exam passed, Board,Passing Year,Percentage12,Migcir,ProofDOB,Marksheet,GapCertificate) VALUES (
'$value1','$value2','$value3','$value4','$value5','$value6','$value7','$value8','$value9','$value10','$value11','$value12','$value13','$value14','$value15','$value16','$value17','$value18','$value19','$value20','$value21','$value22')");
$res=mysql_query($sql) or die ("Error: ". mysql_error(). " with query ". $sql);
mysql_close();
?>