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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:28:41+00:00 2026-05-22T20:28:41+00:00

I am a newbie updating the database (i have skipped some steps so that

  • 0

I am a newbie updating the database (i have skipped some steps so that i do some things quicker) I have this code but the database does not update and i do not get any error.

<?php
require_once '../includes/configuration.php';

if (isset($_POST['enter']))
{
    $_POST['employee_id_passport'] = $employee_id_passport;
    $_POST['first_name'] = $first_name;
    $_POST['surname'] = $surname;
    $_POST['mobile_number'] = $mobile_number;
    $sql_query_update = "UPDATE employee_master 
                             SET first_name = '$first_name', 
                             surname = '$surname', 
                             mobile_number = '$mobile_number' 
                             WHERE employee_id_passport = '$employee_id_passport'";
            $result = mysql_query($sql_query_update, $connection);
    echo "this";

}
else
    {

            //display form with employee details
            if (isset($_GET['idno']))
            {
                $employee_id_passport = $_GET['idno'];

                $sql_get_employee_details_query = "SELECT * FROM employee_master WHERE employee_id_passport = '$employee_id_passport'";
                $result = mysql_query($sql_get_employee_details_query, $connection);
                $row = mysql_fetch_assoc($result);
                echo $row['employee_id_passport'] . "<br /> " . $row['surname'] . "<br /> " . $row['first_name'] . "<br /> " . $row['mobile_number'] . "<br /> ";



                echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"";
                echo "\"http:www.w3.org/TR/xhthml1/DTD/xhtml1-transitional.dtd\">";

                echo "<html xmls=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">";

                echo "<head>";
                echo    "<title> </title>";

                echo    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />";
                echo "</head>";

                echo "<body>";
                echo   "<form name=\"view_employee\" method=\"POST\" action=\"" .  $_SERVER['PHP_SELF'] . " \"   />";
                echo        "Employee ID/Passport: <input type=\"text\" name=\"id_passport\" disabled=\"disabled\" value=\" " .  $row['employee_id_passport'] . "\" /> <br />";
                echo        "First Name: <input type=\"text\" name=\"first_name\" value=\" ".  $row['first_name'] .  "\" /> <br />";
                echo        "Surname: <input type=\"text\" name=\"surname\" value=\" " .  $row['surname'] . "\" /> <br />";
                echo        "Mobile Number: <input type=\"text\" name=\"mobile_number\" value=\" " .   $row['mobile_number'] . "\"/> <br />";
                echo        "<input type=\"submit\" value=\"enter\" name=\"submit\" />";
                echo    "</form>";
                echo "</body>";

                echo "<html>";
            }
    }

?>
  • 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-05-22T20:28:41+00:00Added an answer on May 22, 2026 at 8:28 pm

    It looks like you’ve assigned the sql query string to a variable but not actually run it.

    if (isset($_POST['enter']))
    {
        $_POST['employee_id_passport'] = $employee_id_passport;
        $_POST['first_name'] = $first_name;
        $_POST['surname'] = $surname;
        $_POST['mobile_number'] = $mobile_number;
        $sql_query_update = "UPDATE employee_master SET first_name = '$first_name', surname = '$surname', mobile_number = '$mobile_number' WHERE employee_id_passport = '$employee_id_passport'";
        mysql_query( $sql_query_update ); // This line will run the update query
        echo "this";
    
    }
    

    adding in the ‘mysql_query( $sql_query_update );’ line should execute the query for you.

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

Sidebar

Related Questions

Newbie question here but for some reason I cant figure this out. I have
Newbie question. I have Django models that look like this: class Video(models.Model): uploaded_by =
I'm a Drupal newbie plus I don't have much experience updating code, styles, and
I am a newbie to SQL. please help with this. I have the below
I have very newbie question. How can i check that object of model is
I have a Service that is, for this discussion, holding a number and a
Newbie question, let me try and make this as clear as possible. I have
Newbie to web-services, so asking few basic questions I have a some data around
newbie here! I have source data that contains both simplified and traditional Chinese in
This is probably a really stupid newbie-sounding question to you developer type people, but

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.