There is such a table declaration:
DROP TABLE IF EXISTS users_online; CREATE TABLE users_online( user_id int NOT NULL, lastvisittime DATETIME NOT NULL, PRIMARY KEY(user_id), CONSTRAINT FOREIGN KEY(user_id) REFERENCES user_list(user_id) ON DELETE SET NULL ); But the base swears that the key is incorrectly formed. But I do not understand what is wrong? Can you help?