Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
Message: Duplicate entry '%s' for key %d
I get this message when I try to add a new line in the same table in the
same database (Mysql)
What does '%d" stand for?
--
Luigi Donatello (un italiano che vive in Svezia)
https://www.scaiecat-spa-gigi.com/sv/boende-i-italien.php
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
"Luigi Donatello Asero" <jaggillarfotboll [at] telia.com> skrev i meddelandet
news:plBCe.142236$dP1.495538 [at] newsc.telia.net...
> Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
>
> Message: Duplicate entry '%s' for key %d
>
>
> I get this message when I try to add a new line in the same table in the
> same database (Mysql)
> What does '%d" stand for?
Now I can add new lines but I am still adviced to define a primary key for
the table although I already have a primary key for all the columns!
--
Luigi Donatello (un italiano che vive in Svezia)
https://www.scaiecat-spa-gigi.com/sv/boende-i-italien.php
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
"Luigi Donatello Asero" <jaggillarfotboll [at] telia.com> skrev i meddelandet
news:EmCCe.142238$dP1.495494 [at] newsc.telia.net...
> Now I can add new lines but I am still adviced to define a primary key
for
> the table although I already have a primary key for all the columns!
Except for "rum" which, on the other hand is the name of another index.
--
Luigi Donatello (un italiano che vive in Svezia)
https://www.scaiecat-spa-gigi.com/sv/boende-i-italien.php
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
Luigi Donatello Asero wrote:
> Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
>
> Message: Duplicate entry '%s' for key %d
>
>
> I get this message when I try to add a new line in the same table in the
> same database (Mysql)
> What does '%d" stand for?
There should be some text instead of "%s" and some number instead of "%d"
in the message text you got.
The message suggests that the data you tried to insert into the table
would cause violation of some table constraints (probably PRIMARY KEY,
or UNIQUE). Cause you are the one who put the constraints in the table,
then you should know which constraint you tried to violate and why
it's there.
Hilarion
PS.: You should ask this question on some MySQL newsgroup. It has nothing
to do with PHP.
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
Luigi Donatello Asero wrote:
>> Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
>>
>> Message: Duplicate entry '%s' for key %d
>>
>>
>> I get this message when I try to add a new line in the same table in the
>> same database (Mysql)
>> What does '%d" stand for?
>
> Now I can add new lines but I am still adviced to define a primary key for
> the table although I already have a primary key for all the columns!
It's not "new line" but "new record".
If you really need the answer, then you should post here the SQL statements
you used to generate the table and it's constraints and post example data.
I think you should read some basic tutorials on SQL because it looks like
you do not understand what primary key constraint is and what it's for.
Hilarion
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
Luigi Donatello Asero wrote:
> > Now I can add new lines but I am still adviced to define a primary key
> > for the table although I already have a primary key for all the columns!
>
> Except for "rum" which, on the other hand is the name of another index.
What index? Classic idexes have nothing to do with constraints (there are
exceptions like unique indexes in some SQL engines).
Hilarion
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
"Hilarion" <hilarion [at] SPAM.op.SMIECI.pl> skrev i meddelandet
news:dbg283$h8k$1 [at] news.onet.pl...
> Luigi Donatello Asero wrote:
> > > Now I can add new lines but I am still adviced to define a primary
key
> > > for the table although I already have a primary key for all the
columns!
> >
> > Except for "rum" which, on the other hand is the name of another index.
>
> What index? Classic idexes have nothing to do with constraints (there are
> exceptions like unique indexes in some SQL engines).
It is called Index. And I was talking about mysql ando not sql.
Thatīs why I asked before whether questions about mysql were accepted in
this NG.
--
Luigi Donatello (un italiano che vive in Svezia)
https://www.scaiecat-spa-gigi.com/it/svezia.html
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
"Hilarion" <hilarion [at] SPAM.op.SMIECI.pl> skrev i meddelandet
news:dbg20m$gno$1 [at] news.onet.pl...
> Luigi Donatello Asero wrote:
> >> Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
> >>
> >> Message: Duplicate entry '%s' for key %d
> >>
> >>
> >> I get this message when I try to add a new line in the same table in
the
> >> same database (Mysql)
> >> What does '%d" stand for?
> >
> > Now I can add new lines but I am still adviced to define a primary key
for
> > the table although I already have a primary key for all the columns!
>
>
> It's not "new line" but "new record".
If it is referred to the table it is "new row". I assume that it is "new
record" if it is referred to the database.
But, do you mean that you did not understand what I was talking about?
> If you really need the answer, then you should post here the SQL
statements
> you used to generate the table and it's constraints and post example data.
>
> I think you should read some basic tutorials on SQL because it looks like
> you do not understand what primary key constraint is and what it's for.
Again, you are talking about SQL but I am not working with SQL at present,
I am
working with mysql and, of course I am reading about it as well.
However, I am interested in many different things, not only in php and
mysql!
For example today, I have already read a bit
about servlets, learnt finnish, updated the website and I may learn
something Chinese later. I
am going to need all of them.
By the way, do you know any NG about servlets?
--
Luigi Donatello (un italiano che vive in Svezia)
https://www.scaiecat-spa-gigi.com/sv/rimini.php
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
> It is called Index. And I was talking about mysql ando not sql.
If it's a simple index then it has no influence on table constraints.
And MySQL is SQL database engine, so you are talking about SQL.
Read about SQL table constraints. MySQL is quite close to SQL
standards so you might look at MySQL manuals and/or tutorials but
also at general SQL manuals / tutorials.
Hilarion
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
> > It's not "new line" but "new record".
>
> If it is referred to the table it is "new row". I assume that it is "new
> record" if it is referred to the database.
> But, do you mean that you did not understand what I was talking about?
I understood what you meant, but this does not mean that you should use
wrong terminology.
> > If you really need the answer, then you should post here the SQL
> > statements you used to generate the table and it's constraints and post
> > example data.
> >
> > I think you should read some basic tutorials on SQL because it looks like
> > you do not understand what primary key constraint is and what it's for.
>
> Again, you are talking about SQL but I am not working with SQL at present,
> I am working with mysql and, of course I am reading about it as well.
Again your response proves that you should read some basics cause MySQL
is SQL engine, so we ARE talking about SQL.
> However, I am interested in many different things, not only in php and
> mysql!
> For example today, I have already read a bit
> about servlets, learnt finnish, updated the website and I may learn
> something Chinese later. I
> am going to need all of them.
Maybe you should concentrate on one thing at a time cause your
knowledge of PHP and MySQL is not improving.
> By the way, do you know any NG about servlets?
Nope.
Hilarion
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
"Hilarion" <hilarion [at] SPAM.op.SMIECI.pl> skrev i meddelandet
news:dbgpu1$797$1 [at] news.onet.pl...
> > > It's not "new line" but "new record".
> Again your response proves that you should read some basics cause MySQL
> is SQL engine, so we ARE talking about SQL.
So, do you mean that mysql and SQL are the same thing?
Do you read the other threads or just mine?
> > However, I am interested in many different things, not only in php and
> > mysql!
> > For example today, I have already read a bit
> > about servlets, learnt finnish, updated the website and I may learn
> > something Chinese later. I
> > am going to need all of them.
>
> Maybe you should concentrate on one thing at a time cause your
> knowledge of PHP and MySQL is not improving.
You think that it is not? I do not think so.
But even if it had been the case I had not decided to concentrate on one
thing and especially not on php...
I like doing several things.
--
Luigi Donatello (un italiano che vive in Svezia)
https://www.scaiecat-spa-gigi.com/sv/rimini.php
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
> > Again your response proves that you should read some basics cause MySQL
> > is SQL engine, so we ARE talking about SQL.
>
> So, do you mean that mysql and SQL are the same thing?
> Do you read the other threads or just mine?
I'll repeat what I wrote in another post:
Nope. They are not the same. MySQL is SQL database engine. The relation
is not reversable (SQL is not MySQL).
SQL is a standard which is used (whole or some parts of it, with some
variations) by all SQL database engines. Also by MySQL.
Hilarion
Re: Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)
On Mon, 18 Jul 2005 13:02:55 +0200, Hilarion wrote:
> I think you should read some basic tutorials on SQL because it looks like
> you do not understand what primary key constraint is and what it's for.
No surprise, that
--
JDS | jeffrey [at] example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
PHP » alt.php.sql » Error: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)