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

  • Home
  • SEARCH
  • 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 9129693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:48:25+00:00 2026-06-17T07:48:25+00:00

I have a simple php/html form wich inserts data to my mysql database. I

  • 0

I have a simple php/html form wich inserts data to my mysql database.

I have a column on my database called type.
When a form is submitted with various values I want to be able to check the value of those submitted fields and add a value to the column type based on those values:
If the submitted form field field1 has the value value1 and field field2 has the value value2 then insert value3 to column type on my database.

  • 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-17T07:48:26+00:00Added an answer on June 17, 2026 at 7:48 am

    You can manage this with code, if I understand your question right.
    Remember, it is a good idea to check the post values, before insert or update some values in the database.
    I am using post for the form method, if you use get, replace $_POST with $_GET

    <?php
    if ($_POST["field1"] == "value1" AND $_POST["field2"] =="value2") 
    {  $type = $value3
    }
    else
    {  /// create some defaultvalue if the condition is not true. 
       $type = "youdefaultvalue" 
       // or you use some other value from your form, for example $_POST["field3"]
    }
    // here create your sql-action like "insert into ... " or update .... 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have a really simple html form: <form action=./whatever.php method=POST> <input type=submit
I have a simple html form. On php page. A simple list is placed
I have a simple html form that looks like the following <form action=search.php method=get>
So I have 4 pages. They are very simple. index.php (WORKS) <html> <form action=upload.php
I have a simple HTML form that posts to a PHP page, which will
I have a very simple HTML form on a PHP page for a questionnaire.
I have a simple php email form where the form is validated and submitted
I have a simple html form and some php that input the POST variables
I have a HTML form which is using a simple PHP mail() script to
I have a simple HTML Form as follow (form.html) : <form id=tips-message-notes action=notessaved.php method=post

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.