Bible Trivia
2010-09-25 18:49:43 UTC
Hi-
I have the following table Im using as a 'history' of usage
for users:
create table history
(
userid varchar(20) not null,
dt datetime not null,
primary key(userid, dt)
);
(other members in table not shown)
I want to be able to use 2 columns to speed up the
search over a hundred thousand or more 'userid's based
on the times they accessed the site.
When I insert records into the table, I get back this
error:
Duplicate entry 'myuserid' for key 'PRIMARY'
This is my insert: (other members also not shown)
INSERT INTO history (userid, dt ) VALUES ( '$userid', now() )";
Im using mysql 5.1.48
Is this a real error or a bug? Or did I do something wrong?
Thanks in advance.
I have the following table Im using as a 'history' of usage
for users:
create table history
(
userid varchar(20) not null,
dt datetime not null,
primary key(userid, dt)
);
(other members in table not shown)
I want to be able to use 2 columns to speed up the
search over a hundred thousand or more 'userid's based
on the times they accessed the site.
When I insert records into the table, I get back this
error:
Duplicate entry 'myuserid' for key 'PRIMARY'
This is my insert: (other members also not shown)
INSERT INTO history (userid, dt ) VALUES ( '$userid', now() )";
Im using mysql 5.1.48
Is this a real error or a bug? Or did I do something wrong?
Thanks in advance.