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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:13:53+00:00 2026-06-09T01:13:53+00:00

I am trying to update the password of the table ‘nbk6_user’. when the script

  • 0

I am trying to update the password of the table ‘nbk6_user’.

when the script is launched I get the error: “Fehler”

Am I doing the mysql_query right?

Can anybody help me please?

<?php
include 'conf.php';
$connection = mysql_connect("****", "****", "****");
mysql_select_db($datenbank);
session_start();

if(!isset($_SESSION["name"]))
{
    die("Für diese Seite musst du dich zuerst anmelden!");
}
$name = $_SESSION["name"];

$pw1 = $_POST["pw1"];
$pw2 = $_POST["pw2"];

$pw1 = trim($pw1);
$pw2 = trim($pw2);

if($pw1 == "")
{
die("Kein Passwort gesetzt.");
}

if($pw1 == $pw2)
{
    $query = mysql_query("UPDATE nbk6_user SET password='$pw1', WHERE name='$name'");
    if(!$query)
    {   
        echo "Fehler";
    }
}
else
{
    echo "Die Passwörter stimmen nicht überein";
}
?>
  • 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-09T01:13:56+00:00Added an answer on June 9, 2026 at 1:13 am

    You shouldn’t have a coma after SET and it’s best to avoid inserting the variables inside a string, when dealing with MySQL queries (or any strings really, it’s bad practice).

    Try:

    $query = mysql_query("UPDATE nbk6_user SET password='".$pw1."' WHERE name='".$name."'");
    if(!$query)
    {   
        mysql_error();
        echo "Fehler";
    }
    

    if the changed query doesn’t fix it mysql_error() will explain where the issue is.

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

Sidebar

Related Questions

Im trying to update a table with the following code. If I change WHERE
When trying to update a subversion working copy from Netbeans, I get the following
I am using Linq2Sql and trying to update a table. But no update happens
I am trying to Update a table in an access database from C#. It
I'm trying to do a query on a username table where username and password
I am trying to update a password generator I made to include the ability
I am trying to update an entry in a table usinig Python cx_oracle. The
I'm quite new with PHP/Jquery and I am trying to do an update password
I am trying update my version of sqlite3 on mac os x 10.5.7 I
I am trying update text views while this loop is processing. Here is my

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.