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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:21:53+00:00 2026-05-29T15:21:53+00:00

I just tried everything I could, but nothing works. I think the code is

  • 0

I just tried everything I could, but nothing works. I think the code is self-explanatory:

$username = "stringvalue1";
$password = "stringvalue2";

$query = "INSERT INTO users (username, password)
          VALUES ('$username', '$password')";
mysql_query($query);

It seems alrigth for me, but always returns “Duplicate entry ‘0’ for key ‘username'”, that’s because the username is an UNIQUE row, and there is a 0 value stored yet. The point is, I’m not trying to store any ‘0’, do you have any idea?

Thank you in advance (Y)
And sorry for any mistakes, I’m brazilian.

  • 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-29T15:21:54+00:00Added an answer on May 29, 2026 at 3:21 pm

    Quote your variables properly in query. Also check table structure and columns data-type and default values. Your username column may have an integer type.

       $query = "INSERT INTO users (username, password)
                  VALUES ('".$username."', '".$password."')";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried nearly everything, but I just can't seem to move the cell.textLabel property
Just tried to execute a small Lua script, but unfortunately I'm doing something wrong.
I just tried the tooltip like this Easy image preview ... But i cant
I have just tried using the NSArchiver but for some reason I am getting
I'm generating some CSV output using Ruby's built-in CSV. Everything works fine, but the
I created a UIView xib in Interface Builder and tried everything I could to
i tried now nearly everything i could to solve he following problem. So far
Well, I tried reading as much as I could but can't seem to find
I have just upgraded to SVN 1.7.1 and I have had nothing but problems
I've tried everything Google and StackOverflow have recommended (that I could find) including using

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.