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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:57:35+00:00 2026-05-13T18:57:35+00:00

I am editing my application form.So what i am Doing telling you here..I am

  • 0

I am editing my application form.So what i am Doing telling you here..I am already logged in

  • First of all i am giving a edit link(edit_profile1.php) on my home page
  • NOw i am asking again for username and password so that unauthorized user can not making editing in your profile
  • NOw on edit_profile1.php i am checking username and password sent by user to the username and password stored in database
  • If username and password are correct then i am redirected to edit_profile2.php
  • Here I am creating a form with same text boxes as i used in filling the application form(i am using same name for boxes).Here is a button with name update

For the last page edit_profile3.php i am giving coading here

<?php

    $con=mysql_connect("localhost","root","");
        if(!$con)
        {
        die('Could Not Connect:'.mysql_error());
        } 
        mysql_select_db("tcs",$con);

$usr=$_POST["username"];                 
$pwd=hash('sha1',$_POST['password']);   

$query="select * from employee where Username='$usr' and Password='$pwd'";   

$result=mysql_query($query,$con);


if ($result) 
{

$row=mysql_fetch_array($result);
$sql="update employee set ($row['Username']=$usr,$row['Password']=$pwd");

$deepak=mysql_query($sql,$con);

if($deepak)
{
    echo "Updation Successfull"
}

}
?>

Now when i excute this error is coming like this
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in F:\Study Material\Linux\xampp\htdocs\edit_profile3.php on line 21

Line number 21 is 
 $sql="update employee set ($row['Username']=$usr,$row['Password']=$pwd");

NOw i am not getting where i am getting wrong.Plz also tell me is there any other method for updating application forms any another logic.Plz check out above.

  • 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-13T18:57:36+00:00Added an answer on May 13, 2026 at 6:57 pm

    Apart from the problem with the parentheses that others have already pointed out, shouldn’t it be like this?

    "update employee set password=$pwd WHERE username=$usr"
    

    If you also want to change the username, do something like this:

    "update employee set username=$new_username, password=$pwd WHERE username=$old_username"
    

    See the UPDATE documentation for MySQL for a description of the syntax.

    Also, putting strings like this directly into SQL queries is risky – if you’re not careful you could leave an SQL injection invulnerability. You should use query parameters to ensure that your code is secure. Read more about it from this question on StackOverflow.

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

Sidebar

Related Questions

In a Rails application, I have a particular form with many fields for editing
jQuery.extend( jQuery.jgrid.edit, { ajaxEditOptions: { contentType: application/json }, //form editor reloadAfterSubmit: true // afterSubmit:
In my application's CMS, I have an edit items form. The items users will
I have an image editing application, and I have custom adorners which get added
I need to develop some sort of application featuring Editing Movie slices, Adding and
My application features a CMS for editing Django templates. Whenever I type something like
I have a WPF4 application i have 1 window which editing data : main
I need to do some simple video editing within a Java application, but the
I have modified the Nerd Dinner application to allow editing of child records by
Editing this code here on Stackoverflow and I'm really near to get the result

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.