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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:05:08+00:00 2026-06-04T03:05:08+00:00

I am working on a web app and am having trouble with a trivial

  • 0

I am working on a web app and am having trouble with a trivial issue. I have a table in a database, persons, which consists of the following fields: id, position (in company), username, firstname, lastname. I am working on an edit_user page. I have a main page listing the first+last names of all the users. I can then click on the names and this takes me to the edit_user page corresponding to that user. However, the updates that I make on the website do not get sent to the database (see code below).

//Inserting updates into database
        $query = "UPDATE person SET
            privilege  = '{$privilege}',
            nexus = '{$nexus}',
            firstname ='{$firstname}',
            lastname = '{$lastname}'"; 
        $query .="  WHERE id={$personid}";
        $result = mysql_query($query,$connection); 
        if (mysql_affected_rows() == 1) { 
            $message = "User was successfully updated"; 
        } else { 
            $message = "User was not updated";
            $message .= "<br/>" .mysql_error();
        }

My premonition is that something is wrong with the {$personid}, which was defined by:

function find_selected_user() {
    global $user;
    if (isset($_GET['personid'])) { 
        $personid = $_GET['personid'];
        return $personid
    } else {
        $user = NULL; 
    }
}

(the above function is supposed to return an array of $user’s information)
Please help — I am so stuck! I am sure it is so simple but I’ve been thinking about it too long

  • 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-04T03:05:09+00:00Added an answer on June 4, 2026 at 3:05 am

    You forgot the ending ; character here:

    return $personid
    

    Should be:

    return $personid;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a JSF 2.0 web app, and I'm having trouble passing in
I am working on a web app which makes use of a 3rd party
I am working on a web app in ASP.NET/C# which needs to be scalable
I'm having trouble figuring out why my web service is not working correctly when
I am working on a web app where I have most of my pages
Basically, I started working on this app knowing nothing about web development which is
I'm working on a web.py app for uploading files and im having real problems
I have a codeigniter app working fine locally with WAMP. However, I am having
I'm working as a client-side developer on a web app and found myself having
we're working on a web app with Spring, Hibernate/JPA and Maven. We have several

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.