473,706 Members | 6,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

1062 - Duplicate entry '' for key 2 error

12 New Member
hi i have website http://www.rougejaunevert.com/www/ , i want to join my forum phpbb http://www.rougejaunevert.com/www/forum and my website http://www.rougejaunevert.com/www/ , i have join db of both, and make one table, now i try to register it give this error
1062 - Duplicate entry '' for key 2
Expand|Select|Wrap|Line Numbers
  1. insert into phpbb_users (user_name, user_email, user_forname, user_nickname, user_gender, user_birthday, username, user_password, user_image, user_ip, user_status) values ('saad', 'email@yahoo.com', 'iqba', '5481515', 'Mlle', '11-12-1943', 'saad_sinpk', '4c76827a270ec72b6506b4bada3bf731', 'e80f2021abfd74faf4f533bc8c875b36.jpg', '119.63.136.101', 'active')
[TEP STOP]


help me please it is urgent
Jan 29 '10 #1
21 10011
dgreenhouse
250 Recognized Expert Contributor
There's obviously a record already in the phpbb_users table for at least 1 of the values you're trying to insert - and that column has a 'uniquess' constraint set.

You said you've combined two tables into 1... Probably not a good idea unless you really know what you're doing...

What is the second index key for your modified table?

I noticed that some of your column names are not part of the default phpbb_user table definition...

Hope you have a backup of the original tables...
Jan 29 '10 #2
saadsinpk
12 New Member
can u please add me <email_remove d> and come in my pc by teamviewer and sort me out i am totally confuse please help me :((
Jan 29 '10 #3
dgreenhouse
250 Recognized Expert Contributor
I don't mean to be rude, but you've only made 2 posts so far. As you hopefully understand, I'm reluctant to expose my network to just anyone - I've got too much time and money invested in my infrastructure.

Helping is one thing... Doing the work for you is another...
Jan 29 '10 #4
saadsinpk
12 New Member
can u just add me on yahoo or by any other way by which we can talk directly , please help me i am not hacker or any other bad guy, i just need your help
Jan 29 '10 #5
saadsinpk
12 New Member
here is my table of phpbb_user






there are 3 index file
i have original backup please tell me what i do ?
i want to make similar site <Link to commercial site removed>
Jan 29 '10 #6
dgreenhouse
250 Recognized Expert Contributor
Your not inserting a unique value for username_clean. username_clean has a UNIQUE index constraint set. I assume you might have some other issues, but that's the first thing to correct.

See: http://www.phpbb.com/search/?q=+utf8_clean_string

You also should run the username through utf8_clean_stri ng() creating username_clean before the insert.

You can do it without the function (roll your own), but the included functionality is handy.
Jan 29 '10 #7
saadsinpk
12 New Member
i did not understand what you are saying but i see that when i delete one register user then i try to register it allow me to register, now what i do this username_clean was already in php forum , what i do that if any one register there name show in username_clean also please help me i will be thank full you
Jan 29 '10 #8
dgreenhouse
250 Recognized Expert Contributor
How much programming experience do you have?
Are you using the actual bulletin-board application?
Or are you just using the database from phpBB?
_______________ _______________ _______________

What I was saying in my last post was that you are not including a unique value to the column: username_clean.

I can assume since you did not include username_clean in the query that it is trying to insert whatever the DEFAULT value for that column is - on every insert. That being the case; and since there is a "unique index" set for that column, you'd get an error on the second insert.

You have to include a UNIQUE value for username_clean and it would normally be the value of username passed through the filter utf8_clean_stri ng(). utf8_clean_stri ng() is function that is included with phpBB in the file: /includes/utf/utf_tools.php that comes with phpBB.

As a matter of fact, username should be unique also, but username_clean; I'm guessing, is used to normalize different unicode characters

That is $username_clean = utf8_clean_stri ng($username).

I am no phpBB expert, so my observations are at the very limited level, but I have mucked around with it a little.

I'm afraid to say that you're really going to have to buckle down and learn what you're doing before tearing things apart and putting them back together in un-tested ways. [ I've done it many times though ;-) I guess that's how I learned - by TERROR! ]

Sorry if I'm making an assumption about your abilities. Are you in Ghana?

_______________ _______________ _________

From the page: http://area51.phpbb.com/docs/code/ut...8_clean_string

utf8_clean_stri ng (line 1817)
This function is used to generate a "clean" version of a string.

Clean means that it is a case insensitive form (case folding) and that it is normalized (NFC). Additionally a homographs of one character are transformed into one specific character (preferably ASCII if it is an ASCII character).

Please be aware that if you change something within this function or within functions used here you need to rebuild/update the username_clean column in the users table. And all other columns that store a clean string otherwise you will break this functionality.

return: Cleaned up version of the input string
string utf8_clean_stri ng (string $text)
string $text: An unclean string, mabye user input (has to be valid UTF-8!)
Jan 29 '10 #9
saadsinpk
12 New Member
sir i don't have enough programming experience i am new to this , if you will help me i will be a great fan of you, i will do any thing for you , just solve my problem a big problem
Jan 29 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3945
by: Mohammed Mazid | last post by:
Hi, Basically I have a problem with registering to my quiz system. I had borrowed some code from an existing program but I just do not know why it doesn't work. If (txtUsername = "" Or txtPassword = "") Or (txtFirstName = "" Or txtLastName = "") Then MsgBox "Please complete all the fields", vbCritical = vbOKOnly, "Incomplete Login Details"
0
664
by: jjliu | last post by:
i have a table with two fields (id and myfield). id is a primary key not nll auto_increment, and myfield is set as unique... Due to unique setting for myfield, if i try to insert the duplicate entry for myfield, i will get error message. i was wondering if this is a way that I can avoid error message and let mysql just ignore my duplicate entry, and i can carry on. Thanks a lot for your help.
0
3104
by: Gary Lundquest | last post by:
I have an application with MS Access 2000 as the front end and MySQL as the back end. All was well until I upgraded the MySQL (Linux) server. The Problem: I insert data into a cumulative table. Before when I did this, and there were duplicate entries, the duplicate entries were rejected and I got a return code with the number of affected rows (number added). Now, I get a MyODBC error and the application stops when trying to add...
1
838
by: Gary Lundquest | last post by:
It appears to me that MySQL version 4 returns an error messge when doing an Insert that results in duplicate entries. Version 3 did NOT return an error - it dropped the duplicate entries and ran to completion. Version 4 seems to STOP when it encounters a duplicate entry, so that the records before the duplicate are inserted and the records after the duplicate are not inserted. 3.22.27.1 - previous ver MySQL that did not return error...
4
30022
by: newsfan | last post by:
I get that error when I try to update a table in my database This is my table +----+------------+---------+-----------+ | ID | CPRNR | NAME | SURNAME | +----+------------+---------+-----------+ | 1 | 1234567890 | Ole | Hansson | | 2 | 9876543211 | Ulla | Jensen | | 3 | 1234321234 | Ole | Olsson | | 4 | 7654321234 | Petter | ?es |
1
14039
by: marx | last post by:
I have a bit of a problem and any help would be much appreciated. Problem: I have two dropdown list boxes with same data(all data driven). These are used for two separate entries. For every entry you cannot choose the same value twice. For example, I cannot choose for entry 1 the same value in both selection boxes (gqCategory1Entry1 and gqCategory2Entry1)
8
3940
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on this line: Set rs = db.OpenRecordset("SELECT ID FROM Contacts WHERE (" & sWhere & ");") Contacts being the main table. I am using access 2003 The error message states that there are; Too few parameters. Expected 1 I have no idea how to...
3
2070
by: patelxxx | last post by:
I'm trying to update a template on our Content Management System, however getting the following error. I know its difficult to know what the problem is without looking at the PERL coding, however any advise would be considered: DBD::mysql::db do failed: Duplicate entry 'Lisa.Wulf@<RMed By Mod>' for key 2 at cgi-bin/gen_main.pl line 87 main::__ANON__('DBD::mysql::db do failed: Duplicate entry \'Lisa.Wulf@<RMed By Mod>...',...
1
3388
by: chicago1985 | last post by:
I have a unique constraint in my Oracle table for 3 fields. If I enter duplicate info on the table using Oracle client I will get an Ora message error ORA-00001 that tells me it is a duplicate entry attempt. How do I capture that in my PHP page if someone tries to enter duplicate record info? My PHP Oracle insert statement in the action page: $s = OCIParse($c, "insert into tableOne values ('$varOne', '$varTwo', '$varThree')");...
4
4122
by: AXESMI59 | last post by:
have a project in which I am entering Serial Numbers and Date codes into a Combo box. Serial numbers are all different. However, they could each have the same Date Code. Each Serial Number has a corresponding Date Code which I then write to a table using VBA. When I try to enter a duplicate date code, it automatically finds the duplicate and will not allow me to add it again to that combo box. How do I configure that combo box so I can enter the...
0
8780
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9285
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6614
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4445
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2499
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2092
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.