Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9224815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:25:14+00:00 2026-06-18T04:25:14+00:00

I have noticed that if I submit my form using <form method=post action=> and

  • 0

I have noticed that if I submit my form using

<form method="post" action="">

and changing at least one of the input’s value it is working fine, I mean my save() function is working and saving my records to database.
However, if none of the input values are changed, else {} block is executed which is false for save().
Can anybody explain why it is so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:25:15+00:00Added an answer on June 18, 2026 at 4:25 am

    You may be using something like

    if($query->affected_rows()>0){
    return true;
    }else{
    return false
    }
    

    After doing the database save sql query. So, when changes are made in the form fields, the changes are saved and the first condition becomes true returning true. But when no changes are made in the form field, i.e if the fields are kept intact, no changes is made to the database and the second, i.e else condition gets executed returning false.

    UPDATE

    I could be able to explain it to you more clearly if you post the code. There is nothing wrong with the html form code that you have posted. But you need to post the PHP code which is handling the save operation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple email form: <form method=post action=process-form.php id=emailForm name=emailForm target=_self> <h4>Sign up
I have a simple html form and some php that input the POST variables
I have a basic form that I would like to submit using ajax, without
I have a form that validates using the jQuery plugin: Validation, v1.9.0. The validation
We have noticed that component publishing takes a long time. The component we are
I have noticed that if you add a unobtrusive link in a refreshable partial
I have noticed that deleted branches in svn is not preserved in git. I
I have noticed that ie tends to put the thread for a tab to
I have noticed that it is possible to define a custom class and then
I have noticed that most Objective-C coders never use the self->ivar syntax when accessing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.