I am getting syntax error with the following statement
REPLACE INTO users (screenname, token, secret) VALUES( '$screenname', '$token', '$secret' ) WHERE 'screenname' = $screenname
The table has a primary key named id, which auto-increments.
I am getting syntax error with the following statement
REPLACE INTO users (screenname, token, secret) VALUES( '$screenname', '$token', '$secret' ) WHERE 'screenname' = $screenname
The table has a primary key named id, which auto-increments.
From what i know, REPLACE has no WHERE, you probably want UPDATE instead
You need to have a UNIQUE index on screenname.
Also your quotes are wrong in the WHERE clause:
WHERE screenname = '$screenname'
I'm going to assume all your variables have been put through mysql_real_escape_string() :)
users DROP PRIMARY KEY , ADD PRIMARY KEY ( screenname ) MySQL said: Documentation #1170 - BLOB/TEXT column 'screenname' used in key specification without a key length