I keep getting an error like this when I submit a form. I have no clue what exactly is wrong in what I am doing here.
Kindly have a look at my code below please:
SQLSTATE[23000]: Integrity constraint violation: 1048 Le champ 'r_maritalstatus' ne peut être vide (null)
In English the message reads, "The column 'r_maritalstatus' may not be empty (null)."
If I select a value in r_maritalstatus
then error shows for other field.
Here is this code:
if(!isset($error)){
try {
$stmt = $db->prepare('INSERT INTO resumes (memberID, r_name,r_email,r_mobile,r_address,r_dob,r_maritalstatus,r_nationality,r_religion,r_sex,r_objective,r_languagesknown,r_hobbies,r_expcategory,r_exptype,r_exptitle1,r_expcompany1,r_expcity1,r_expfrom1,r_expto1,r_expdescription1,r_exptitle2,r_expcompany2,r_expcity2,r_expfrom2,r_expto2,r_expdescription2,r_exptitle3,r_expcompany3,r_expcity3,r_expfrom3,r_expto3,r_expdescription3,r_exptitle4,r_expcompany4,r_expcity4,r_expfrom4,r_expto4,r_expdescription4,r_exptitle5,r_expcompany5,r_expcity5,r_expfrom5,r_expto5,r_expdescription5,r_eduinstname1,r_edudegree1,r_edustudyfield1,r_educity1,r_edupassed1,r_eduinstname2,r_edudegree2,r_edustudyfield2,r_educity2,r_edupassed2,r_eduinstname3,r_edudegree3,r_edustudyfield3,r_educity3,r_edupassed3,r_eduinstname4,r_edudegree4,r_edustudyfield4,r_educity4,r_edupassed4,r_eduinstname5,r_edudegree5,r_edustudyfield5,r_educity5,r_edupassed5,r_skill1,r_skillexp1,r_skill2,r_skillexp2,r_skill3,r_skillexp3,r_skill4,r_skillexp4,r_skill5,r_skillexp5) VALUES (:memberID, :r_name, :r_email, :r_mobile, :r_address, :r_dob, :r_maritalstatus, :r_nationality, :r_religion, :r_sex, :r_objective, :r_languagesknown, :r_hobbies, :r_expcategory, :r_exptype, :r_exptitle1, :r_expcompany1, :r_expcity1, :r_expfrom1, :r_expto1, :r_expdescription1, :r_exptitle2, :r_expcompany2, :r_expcity2, :r_expfrom2, :r_expto2, :r_expdescription2, :r_exptitle3, :r_expcompany3, :r_expcity3, :r_expfrom3, :r_expto3, :r_expdescription3, :r_exptitle4, :r_expcompany4, :r_expcity4, :r_expfrom4, :r_expto4, :r_expdescription4, :r_exptitle5, :r_expcompany5, :r_expcity5, :r_expfrom5, :r_expto5, :r_expdescription5, :r_eduinstname1, :r_edudegree1, :r_edustudyfield1, :r_educity1, :r_edupassed1, :r_eduinstname2, :r_edudegree2, :r_edustudyfield2, :r_educity2, :r_edupassed2, :r_eduinstname3, :r_edudegree3, :r_edustudyfield3, :r_educity3, :r_edupassed3, :r_eduinstname4, :r_edudegree4, :r_edustudyfield4, :r_educity4, :r_edupassed4, :r_eduinstname5, :r_edudegree5, :r_edustudyfield5, :r_educity5, :r_edupassed5, :r_skill1, :r_skillexp1, :r_skill2, :r_skillexp2, :r_skill3, :r_skillexp3, :r_skill4, :r_skillexp4, :r_skill5, :r_skillexp5)');
$stmt->execute(array(
':memberID' => $uid,
':r_name' => $rname,
':r_email' => $remail,
':r_mobile' => $rmobile,
':r_address' => $raddress,
':r_dob' => $rdob,
':r_sex' => $rsex,
':r_maritalstatus' => $rmaritalstatus,
':r_nationality' => $rnationality,
':r_religion' => $rreligion,
':r_objective' => $robjective,
':r_languagesknown' => $rlanguagesknown,
':r_hobbies' => $rhobbies,
':r_expcategory' => $rjobcategory,
':r_exptype' => $rjobtype,
':r_exptitle1' => $rjobtitle1,
':r_expcompany1' => $rjobcompany1,
':r_expcity1' => $rjobcity1,
':r_expfrom1' => $rjobfrom1,
':r_expto1' => $rjobto1,
':r_expdescription1' => $rjobdescription1,
':r_exptitle2' => $rjobtitle2,
':r_expcompany2' => $rjobcompany2,
':r_expcity2' => $rjobcity2,
':r_expfrom2' => $rjobfrom2,
':r_expto2' => $rjobto2,
':r_expdescription2' => $rjobdescription2,
':r_exptitle3' => $rjobtitle3,
':r_expcompany3' => $rjobcompany3,
':r_expcity3' => $rjobcity3,
':r_expfrom3' => $rjobfrom3,
':r_expto3' => $rjobto3,
':r_expdescription3' => $rjobdescription3,
':r_exptitle4' => $rjobtitle4,
':r_expcompany4' => $rjobcompany4,
':r_expcity4' => $rjobcity4,
':r_expfrom4' => $rjobfrom4,
':r_expto4' => $rjobto4,
':r_expdescription4' => $rjobdescription4,
':r_exptitle5' => $rjobtitle5,
':r_expcompany5' => $rjobcompany5,
':r_expcity5' => $rjobcity5,
':r_expfrom5' => $rjobfrom5,
':r_expto5' => $rjobto5,
':r_expdescription5' => $rjobdescription5,
':r_eduinstname1' => $reduinst1,
':r_edudegree1' => $redudegree1,
':r_edustudyfield1' => $redustudyfield1,
':r_educity1' => $reducity1,
':r_edupassed1' => $reduyear1,
':r_eduinstname2' => $reduinst2,
':r_edudegree2' => $redudegree2,
':r_edustudyfield2' => $redustudyfield2,
':r_educity2' => $reducity2,
':r_edupassed2' => $reduyear2,
':r_eduinstname3' => $reduinst3,
':r_edudegree3' => $redudegree3,
':r_edustudyfield3' => $redustudyfield3,
':r_educity3' => $reducity3,
':r_edupassed3' => $reduyear3,
':r_eduinstname4' => $reduinst4,
':r_edudegree4' => $redudegree4,
':r_edustudyfield4' => $redustudyfield4,
':r_educity4' => $reducity4,
':r_edupassed4' => $reduyear4,
':r_eduinstname5' => $reduinst5,
':r_edudegree5' => $redudegree5,
':r_edustudyfield5' => $redustudyfield5,
':r_educity5' => $reducity5,
':r_edupassed5' => $reduyear5,
':r_skill1' => $rskill1,
':r_skillexp1' => $rskillexp1,
':r_skill2' => $rskill2,
':r_skillexp2' => $rskillexp2,
':r_skill3' => $rskill3,
':r_skillexp3' => $rskillexp3,
':r_skill4' => $rskill4,
':r_skillexp4' => $rskillexp4,
':r_skill5' => $rskill5,
':r_skillexp5' => $rskillexp5
));
} catch(PDOException $e) {
$error[] = $e->getMessage();
}
}
echo print_r($_POST);
}
thanks and regards