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 7791929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:03:06+00:00 2026-06-01T22:03:06+00:00

I understand how to update active user data via using a form… But how

  • 0

I understand how to update active user data via using a form… But how to i update a certain column for the currently active user by click a button NO FORMS for example… i have a main page where a user can login via facebook, well when they login and accept permissions it then forwards them to the next step of my application, when they successfully authenticate all there information is stored onto my local mysql database in a users table. now they see the next page which consist of two buttons. Now what i want is if they click the “doctor” button it updates the column “job” to say doctor, and visa versa if they click “programmer” it updates the “job” column to programmer.

I’m trying to totally avoid letting them fill out information, I just want it to be a click this button append this to that field or click this button append that. If I’m not making any since, let me know and I will gladly explain in further details.

  • 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-01T22:03:07+00:00Added an answer on June 1, 2026 at 10:03 pm

    Do you mean something like this?

    Update

    Your php file:

    <?php
    
    if($_POST['Doctor']){
    
        $sql =("UPDATE users SET job='Doctor' WHERE userid='$someactiveuserid'");
        $result = mysql_query($sql) or die(mysql_error());
    
    } elseif($_POST['Programmer']){
    
        $sql =("UPDATE users SET job='Programmer' WHERE userid='$someactiveuserid'");
        $result = mysql_query($sql) or die(mysql_error());
    
    }
    
    ?>
    
    <html>
    <body>
        <form method="post" name="form1" action="<?php echo $_SERVER['PHP_SELF']; ?>">
        <input type="submit" name="Programmer" value="Programmer"></br>
        <input type="submit" name="Doctor" value="Doctor">
        </form> 
    </body>
    </html>
    

    Hope this helps!

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

Sidebar

Related Questions

I understand the pros of using namespaces within the actual application layers but when
I can't currently understand why my update method in my repository for the style
Why only one overload throws this exception? Little update: I understand that there was
I want to understand how I can update my GUI with a simple text
I understand the principles but i have a hard time seeing where the practical
I understand the value of the three-part service/host/client model offered by WCF. But is
How to get any http session by id or all currently active http sessions
I don't understand how to update a fucntion's initial parameters once they've been set.
I am having a problem using PHP's PDO object to prepare an update statement
I understand that Web Site Projects compile source on-the-fly, and Web Application Projects pre-compile

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.