-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'
8
  • 1
    What error you get Commented Jan 5, 2018 at 5:24
  • May be it's question duplicate : stackoverflow.com/questions/8893551/update-query-php-mysql Commented Jan 5, 2018 at 5:24
  • can you post query that you tried on phpmyadmin? Commented Jan 5, 2018 at 5:25
  • @maddy23285 this is the error, i am getting. Commented Jan 5, 2018 at 5:44
  • @TarangP - this is the error, i am getting. Commented Jan 5, 2018 at 5:45

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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!!

3 Comments

@Gaurav Singh edited that question after I posted my answer
At that time how would anyone know what is the error he getting @TarangP
Also I dont have that much point to ask query in comment @TarangP

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.