[thelist] PHP: Insert or Replace (upon duplicate IP)
rudy
r937 at interlog.com
Tue Apr 9 12:34:01 CDT 2002
you can have only one unique key on a mysql table?
doesn't sound right
CREATE INDEX is mapped to an ALTER TABLE statement
to create indexes. See section 6.5.4 ALTER TABLE Syntax.
Normally, you create all indexes on a table at the time the table
itself is created with CREATE TABLE. See section 6.5.3 CREATE
TABLE Syntax. CREATE INDEX allows you to add indexes to existing
tables.
http://www.mysql.com/doc/C/R/CREATE_INDEX.html
maybe there's a problem with ALTER on evolt's server
try dropping and then recreating the table with all indexes
the way to handle your duplicate problem is simply to go ahead and do the
insert
if it fails, it was a duplicate
not sure how to trap that if you need to display a result message
rudy
More information about the thelist
mailing list