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

  • Home
  • SEARCH
  • 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 6060263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:48:21+00:00 2026-05-23T08:48:21+00:00

I have two problems. problem one: I am trying to create a registeration form

  • 0

I have two problems.
problem one:
I am trying to create a registeration form where users can register with my website.
when I run this mysql statement a get dublicate entry found error:

$sql "insert into users(username, password) values('$username, sha('$password'))";

Duplicate entry ‘da39a3ee5e6b4b0d3255bfef95601890afd80709’ for key ‘password’
despite the fact that I changed the the string sha(‘$password’) several times.
please help.

else{
   include("databaseconnection.php");
   $databaseconnect = connect($host,$user,$password,$database)
      or die("couldnot connect to database serever.\n");
   $database_select = mysql_select_db($database,$databaseconnect)
      or die("could not select dabases.\n " .mysql_error());
   $query2 = "insert into company(username,password)
      values('$username',sha1('$password'))";
   $result2 = mysql_query($query2,$databaseconnect);
   echo "you have been registered as '$companyloginName' <br/>";
   header("Location:/index.php");

my login php script is as follow:

   $result ="select username, password form users where username ='$username' and password = sha('$password');
    if(mysql_num_rows($reuslt)==1){
   echo"welcome '$username";
    }
  • 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-23T08:48:21+00:00Added an answer on May 23, 2026 at 8:48 am

    da39a3ee5e6b4b0d3255bfef95601890afd80709 is the sha1 hash of the empty string. Make sure that you actually insert the password into your SQL query, for example by echoing the query instead of sending it to the SQL server.

    Edit With the new information added to your question, check out these two lines:

    include("databaseconnection.php");
    $databaseconnect = connect($host,$user,$password,$database)
    

    Here, $password is the password used to connect to the database. The inclusion of databaseconnection.php probably overwrites what was previously in the $password variable.

    Try to echo $query2 and you’ll probably see it for yourself, that the SQL query doesn’t include any password at all or that the password therein is not the same as the one entered by the user.

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

Sidebar

Related Questions

Problem: I have two spreadsheets that each serve different purposes but contain one particular
The problem: I often have to update two or more repositories: One for the
I am wondering how you would approach this problem I have two Taxrates that
Alright so I'm trying to create a method called: setIncrement(). I have two classes
i have to switch in between two table as per users choice i can
I am trying to create a stop watch type functionality. I have one label
I used pole display(E POS) in my POS c# application.I have two major problem
Here's my problem at a high level: We have two business applications. App1 inputs
I actually have two questions regarding the same problem but I think it is
I am working on a business problem in C#.NET. I have two classes, named

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.