-4

Please Correct me here, i am trying to update or insert values in existing row in my database, but not able to this, all the variables is working but its not getting into database also checked in phpmyadmin sql query but it was not working there also, there it shows success but not a single data getting into mysql columns..

include("connect.php");

$sql = "UPDATE tblapps SET applsex='$applsex', placbrth='$placbrth', countrybrth='$countrybrth', religionxx='$religionxx', visualmark='$visualmark', edu_id='$edu_id', nationality_by='$nationality_by', prev_nationality='$prev_nationality', issueplace='$issueplace', expirydate='$expirydate', othpassport='$otherpassport', oth_passportno='$oth_pass_no', oth_pptissueplc='$oth_ppt_issue_place', oth_pptissuentl='$oth_ppt_nationality', country_issue='$country_issue', previssuedate='$previssuedate' WHERE app_id=$appid";
if(mysqli_query($link, $sql)){
    echo "Records were updated successfully.";
} else {
    echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}

?>

this is the error, I am getting.

ERROR: Could not able to execute UPDATE tblapps SET applsex='', placbrth='delhi', countrybrth='United States', religionxx='CHRISTIAN', visualmark='', edu_id='GRADUATE', nationality_by='By Birth', prev_nationality='', issueplace='delhi', expirydate='2018-11-01', othpassport='on', oth_passportno='9876546789', oth_pptissueplc='delhi', oth_pptissuentl='United States', country_issue='', previssuedate='2018-01-02' WHERE app_id='1515130357782247085'. Unknown column 'othpassport' in 'field list'
Gaurav Singh
  • 43
  • 2
  • 10

2 Answers2

2

Unknown column 'othpassport' in 'field list'

This meant to say that othpassport coloumn is not available in your database table. Kindly check table or rename it.

i hope it helps.

TarangP
  • 2,711
  • 5
  • 20
  • 41
1

You are getting error : Unknown column 'othpassport' in 'field list'

This meant to say that othpassport coloumn is not available in your database table or you typed it wrong. And according to your coding style I think the column name may be otherpassport . Hope you find it helpful , Thanks!!