0
createTable('members', 'user VARCHAR(16), pass VARCHAR(16),
            INDEX(user(6))');

createTable('messages', 
           'id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
            auth VARCHAR(16), recip VARCHAR(16), pm CHAR(1),
            time INT UNSIGNED, message VARCHAR(4096),
            INDEX(auth(6)), INDEX(recip(6))');

createTable('friends', 'user VARCHAR(16), friend VARCHAR(16),
            INDEX(user(6)), INDEX(friend(6))');

createTable('profiles', 'user VARCHAR(16), text VARCHAR(4096),
            INDEX(user(6))');

有人可以帮我找出问题所在吗?

4

1 回答 1

1

您的 sql 语法不正确。试试这个。

CREATE Table `members`
(
    `user` VARCHAR(16), 
    `pass` VARCHAR(16),
    INDEX (`user`)
);

Create Table `messages`
(
    `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `auth` VARCHAR(16), 
    `recip` VARCHAR(16), 
    `pm` CHAR(1),
    `time` INT UNSIGNED, 
    `message` VARCHAR(4096),
    INDEX(`auth`, `recip`)
);


CREATE Table `friends`
(
    `user` VARCHAR(16), 
    `friend` VARCHAR(16),
    INDEX(`user`, `friend`)
);

create Table `profiles` 
(
    `user` VARCHAR(16), 
    `text` VARCHAR(4096),
    INDEX(`user`)
);
于 2012-05-27T02:33:19.843 回答