Below is my php code which i need to save the jobseeker resume in database. But does not function and show the message: Column count doesn't match value count at row 1 after i add a field name resume_ID as a primary key in phpMyadmin. i dont know what is the error i done. Thanks.
do_resume.php
[PHP]<?php
include_once("d atabase.php");
class user {
function linkid ()
{
$db = new db();
$link_id = $db->dbconnect();
return $link_id;
} // end function linkid
function add_user($arr)
{
$link_id = $this->linkid();
$fullName = $arr['fullName'];
$nric = $arr['nric'];
$gender = $arr['gender'];
$day = $arr['day'];
$month = $arr['month'];
$year = $arr['year'];
$maritalStatus = $arr['maritalStatus'];
$nationality = $arr['nationality'];
$emailAdd = $arr['emailAdd'];
$contactNum = $arr['contactNum'];
$contactAdd = $arr['contactAdd'];
$languages1 = $arr['languages1'];
$languages2 = $arr['languages2'];
$education = $arr['education'];
$workExp = $arr['workExp'];
$curricularAct = $arr['curricularAct'];
$skills = $arr['skills'];
$references = $arr['references'];
if($fullName==" "){
$message="Opps. . You forgot enter your Full Name!<br>";
include("resume .php");
}
else
if($nric==""){
$message="Opps. . You forgot enter your NRIC!<br>";
include("resume .php");
}
else
if($gender=="") {
$message="Pleas e select your Gender!<br>";
include("resume .php");
}
else
if($maritalStat us==""){
$message="Pleas e select your Marital Status!<br>";
include("resume .php");
}
else
if($nationality ==""){
$message="Opss. . You forgot enter your Nationality!<br >";
include("resume .php");
}
else
if($emailAdd==" "){
$message="Opps. . You forgot enter your Email Address!<br>";
include("resume .php");
}
else
if($contactNum= =""){
$message="Opps. . You forgot enter your Contact Number!<br>";
include("resume .php");
}
else
if($contactAdd= =""){
$message="Opps. . You forgot enter your Contact Address!<br>";
include("resume .php");
}
else
if($languages1= =""){
$message="Pleas e select your Languages(oral) !<br>";
include("resume .php");
}
else
if($languages2= =""){
$message="Pleas e select your Languages(writt en)!<br>";
include("resume .php");
}
else
if($education== ""){
$message="You need to fill in your Education Level!<br>";
include("resume .php");
}
else
if($workExp=="" ){
$message="You need to fill in your Work Experiences!<br >";
include("resume .php");
}
else
if($references= =""){
$message="You need to fill in your References!<br> ";
include("resume .php");
}
else
{
$myquery = "INSERT INTO resume
VALUES ( '$fullName', '$nric', '$gender', '$day', '$month', '$year', '$maritalStatus ', '$nationality', '$emailAdd', '$contactNum', '$contactAdd', '$languages1', '$languages2', '$education', '$workExp', '$curricularAct ', '$skills', '$references' )";
$result = mysql_query($my query,$link_id) or die(mysql_error ());
include_once("r esume_success.p hp");
}
}
}
?>[/PHP]
do_resume_Pre.p hp
[PHP]<?php
include_once("d o_resume.php");
$act = $_REQUEST['act'];
if ($act == 'adduser') {
$arr = $_REQUEST;
$usr = new user();
$usr->add_user($arr) ;
exit();
}
?>[/PHP]
database.php
[PHP]<?php
class db {
var $sqlserver = "localhost" ;
var $sqldatabase = "ums e-job portal";
var $sqluser = "root";
var $sqlpass = "";
var $link_id;
function dbconnect () {
$link_id = mysql_connect($ this->sqlserver, $this->sqluser, $this->sqlpass);
$dbh = mysql_select_db ($this->sqldatabase) ;
return $this->link_id = $link_id;
}
}
?>[/PHP]
resume_success. php
[PHP]<?php
include("index. php");
?>[/PHP]
do_resume.php
[PHP]<?php
include_once("d atabase.php");
class user {
function linkid ()
{
$db = new db();
$link_id = $db->dbconnect();
return $link_id;
} // end function linkid
function add_user($arr)
{
$link_id = $this->linkid();
$fullName = $arr['fullName'];
$nric = $arr['nric'];
$gender = $arr['gender'];
$day = $arr['day'];
$month = $arr['month'];
$year = $arr['year'];
$maritalStatus = $arr['maritalStatus'];
$nationality = $arr['nationality'];
$emailAdd = $arr['emailAdd'];
$contactNum = $arr['contactNum'];
$contactAdd = $arr['contactAdd'];
$languages1 = $arr['languages1'];
$languages2 = $arr['languages2'];
$education = $arr['education'];
$workExp = $arr['workExp'];
$curricularAct = $arr['curricularAct'];
$skills = $arr['skills'];
$references = $arr['references'];
if($fullName==" "){
$message="Opps. . You forgot enter your Full Name!<br>";
include("resume .php");
}
else
if($nric==""){
$message="Opps. . You forgot enter your NRIC!<br>";
include("resume .php");
}
else
if($gender=="") {
$message="Pleas e select your Gender!<br>";
include("resume .php");
}
else
if($maritalStat us==""){
$message="Pleas e select your Marital Status!<br>";
include("resume .php");
}
else
if($nationality ==""){
$message="Opss. . You forgot enter your Nationality!<br >";
include("resume .php");
}
else
if($emailAdd==" "){
$message="Opps. . You forgot enter your Email Address!<br>";
include("resume .php");
}
else
if($contactNum= =""){
$message="Opps. . You forgot enter your Contact Number!<br>";
include("resume .php");
}
else
if($contactAdd= =""){
$message="Opps. . You forgot enter your Contact Address!<br>";
include("resume .php");
}
else
if($languages1= =""){
$message="Pleas e select your Languages(oral) !<br>";
include("resume .php");
}
else
if($languages2= =""){
$message="Pleas e select your Languages(writt en)!<br>";
include("resume .php");
}
else
if($education== ""){
$message="You need to fill in your Education Level!<br>";
include("resume .php");
}
else
if($workExp=="" ){
$message="You need to fill in your Work Experiences!<br >";
include("resume .php");
}
else
if($references= =""){
$message="You need to fill in your References!<br> ";
include("resume .php");
}
else
{
$myquery = "INSERT INTO resume
VALUES ( '$fullName', '$nric', '$gender', '$day', '$month', '$year', '$maritalStatus ', '$nationality', '$emailAdd', '$contactNum', '$contactAdd', '$languages1', '$languages2', '$education', '$workExp', '$curricularAct ', '$skills', '$references' )";
$result = mysql_query($my query,$link_id) or die(mysql_error ());
include_once("r esume_success.p hp");
}
}
}
?>[/PHP]
do_resume_Pre.p hp
[PHP]<?php
include_once("d o_resume.php");
$act = $_REQUEST['act'];
if ($act == 'adduser') {
$arr = $_REQUEST;
$usr = new user();
$usr->add_user($arr) ;
exit();
}
?>[/PHP]
database.php
[PHP]<?php
class db {
var $sqlserver = "localhost" ;
var $sqldatabase = "ums e-job portal";
var $sqluser = "root";
var $sqlpass = "";
var $link_id;
function dbconnect () {
$link_id = mysql_connect($ this->sqlserver, $this->sqluser, $this->sqlpass);
$dbh = mysql_select_db ($this->sqldatabase) ;
return $this->link_id = $link_id;
}
}
?>[/PHP]
resume_success. php
[PHP]<?php
include("index. php");
?>[/PHP]
Comment